Commit Graph

124 Commits

Author SHA1 Message Date
Federico Baron
98db0df4ab Hide QSB (toast) when editing workspace
Here we hide QSB when we enter drag mode in order to follow the guidelines set by https://docs.google.com/presentation/d/1FOmmCdmGmSMR77_901IOMbvbPVxPmjaAdxZjy-D9tw0/edit#slide=id.g159289e55db_0_229

Bug: 251259222
Test: Enter edit mode with SHOW_HOME_GARDENING flag on, notice how QSB disappears when we enter drag
Change-Id: If1a00ac62cec21a641295494d3a2dbb1f267bd62
2022-10-25 10:47:48 -07:00
Federico Baron
0abfda8f2f Rename first page pinned widget to mFirstPagePinnedWidget
mQsb is the name used for the first page pinned widget. This variable name is bad since in some launchers the first page pinned widget is a qsb but sometimes it is a smartspace. Renaming the variable to mFirstPagePinnedWidget is a more accurate name for this variable.

Bug: 251259222
Test: N/A
Change-Id: I6d3c74163995d2267510ee546924917062c4955c
2022-10-21 13:01:24 -07:00
Federico Baron
a56f08e677 Set smartspace to 30% visibility on workspace edit for home gardening
Here we set the smartspace to have 30% visibility to follow the guidelines set by https://docs.google.com/presentation/d/1FOmmCdmGmSMR77_901IOMbvbPVxPmjaAdxZjy-D9tw0/edit#slide=id.g159289e55db_0_229

Bug: 251259222
Test: Enter drag mode in workspace with SHOW_HOME_GARDENING flag on to see the changes
Change-Id: Ia2ef4f1a49549fef9f8fbea7c007db8b81972f71
2022-10-21 13:00:58 -07:00
Luca Zuccarini
ef006c7603 Update the NORMAL->ALL_APPS transition when tapping on QSB on phones.
- New interpolators
- New duration
- Removed workspace translation
- Removed overlapping fades -- are now sequential

See video in the bug.

Bug: 227745955
Test: manual
Change-Id: I19fa19a3806e963a04c5e694a52d3c1b921cf51f
2022-05-06 16:07:17 +00:00
Anushree Ganjam
f6254c5947 Do not add HOTSEAT_ICONS to visible elements for device type "phone" in
ALL_APPS State

HOTSEAT_ICONS got added to visible elements for ALL_APPS State in ag/16992837.

============================================================
Phone
Before:
HotSeat present in view hierarchy - https://hsv.googleplex.com/4906040983289856?node=41
Video: https://b.corp.google.com/issues/228803923#comment9

After:
HotSeat not present in view hierarchy - https://hsv.googleplex.com/5379653922455552?node=42
Video: https://b.corp.google.com/issues/228803923#comment11
============================================================

Tablets

I couldn't test this implementation on tablet. But I have verified on a phone
locally by adding HOTSEAT_ICONS to visible elements and then verifying
"IMPORTANT_FOR_ACCESSIBILITY_NO_HIDE_DESCENDANTS" get set and hotseat icons are not focusable in all apps.
Video : https://b.corp.google.com/issues/228803923#comment14

============================================================

Bug: 228803923
Bug: 227565451

Test: Manual. See the video attached in bug.
Change-Id: I055e3bb61c8cfd240e0fe1000fe3a391a150f6d1
2022-04-29 23:33:48 +00:00
Shikha Malhotra
f78da1bae3 Review comments followup
These are review comments followup from ag/17399997

Bug: b/218187058
Test: manually test thet Launcher3 features work correctly
Change-Id: I9865a37c1ed663370dc28e7678994f3d961e3cd1
2022-04-12 14:33:07 +00:00
Pat Manning
b04dd608bf Add workspace page translations for edit state.
Bug: 202971709
Test: manual
Change-Id: Ic807d380053b8cc5aaf521513c308854e1b14a43
2022-03-22 17:58:19 +00:00
Nicolo' Mazzucato
5765d42ada Fix jump in animation for hotseat while re-arranging icons
While re-arranging icons the hotseat remains in scale 1.0f, while the workspace reduces it's scale (as defined by SpringLoadedState.java). Previously, the code to aggregate animations was assuming hotseat and workspace always had the same scale.

MultiScaleProperty.get() was being used to set the starting value of the animation. Previously, it was returning the last aggregated value. However, this value was correct only for the workspace, but not for the hotseat. Returning the current view scale makes it always correct.

Bug: 220271046
Test: Dragged icons from hotseat to workspace, and verified animation didn't jump
Change-Id: Ic01776c1d8e3967624626ed7c44d194a06295790
2022-02-22 18:27:26 +01:00
Nicolo' Mazzucato
12131a40fe Add Z scaling during unfold to launcher
The unfold progresses are mapped to 0.85 - 1 range and set as a scale for launcher.

In case of multiple scale animations for workspace and hotseat, they are combined using MultiScaleProperty (e.g. opening an app while unfolding/going to all apps while unfolding). Note that this is a pretty difficult scenario to be in. If that happens, we multiply all values and bound the result between the max and min values.

Bug: 217368525
Test: atest MultiScalePropertyTest and manually
Change-Id: I6131c39f36deade0b7280c72edda2d72045344e9
2022-02-15 17:02:36 +01:00
Samuel Fufa
41f15a107f [Search] Resolve afterimage when closing allapps
Preview: https://drive.google.com/file/d/1AM6WAY4kImCgHueNvH6eXUtnHgK3U6vo/view?usp=sharing&resourcekey=0-3mzBobzFuzQXCNZRUlToYA
Test: Manual
Bug: 184711608
Bug: 188556051
Change-Id: Ib43c71083460c236347dd1f340b1ad95d7d4aa15
2021-05-25 17:34:18 -05:00
Samuel Fufa
3ab273da0c [Search][Motion] Modify interpolator for AllApps background scrim
Also rename ANIM_WORKSPACE_SCRIM_FADE to ANIM_SCRIM_FADE since
the scrim is shared between states now.

Bug: 183001675
Test: Manual in 3 button and 0 button modes
Change-Id: Ice83b54480bdf74155e8593c421b68d7186cf78a
2021-05-03 21:13:20 -07:00
TreeHugger Robot
45167d6030 Merge "Removing dependency on wallpaper colors and using theme resources" into sc-dev 2021-04-28 03:00:17 +00:00
Sunny Goyal
4ed0fb5074 Removing dependency on wallpaper colors and using theme resources
Bug: 184676715
Test: Manual
Change-Id: Ie9a9a784c4a8a8cd484bfd8ea463deedcd4deed6
2021-04-27 16:29:08 -07:00
Zak Cohen
4d35ac3020 Allow Workspace Scrim to be colored per state
Make it possible to set the color of workspace scrim to a different color
per state. Motivated by making Overview Scrim and All Apps scrims different
colors.

Bug: 186253733
Test: Local build and flash
Change-Id: Id7c38ce3c9173308eedfcb7592ececa7bd6bf220
2021-04-27 14:04:46 -07:00
Zak Cohen
079003b44d Revert "[Search][Motion] Separate AllApps scrim and content interpolation"
This reverts commit 8c383f97e4.

Reason for revert: ScrimView is used in multiple places, Overview is broken by this change.

Change-Id: Ie395e2d94feaca4c9365bb5da68e9dc219990e03
2021-04-26 23:59:07 +00:00
Samuel Fufa
8c383f97e4 [Search][Motion] Separate AllApps scrim and content interpolation
video: https://drive.google.com/file/d/18jTh8Lc8hf-c1GBGaWERHo4QIvAHBA8J/view?usp=sharing&resourcekey=0-RDJgw-ecOW3nnF6_tWkgCg
Bug: 183001675
Test: visual
Change-Id: Idb177fd3e31ac41f57379ac45b80e7246c0dd156
2021-04-22 22:55:00 -05:00
Jon Miranda
c9ad2dd6c7 Add new app close implementation.
- We remove the fling completely
- We set damping to 1 for x/y springs so there is no
  bounciness, and updated the stiffness and bounds to tighten
  up the path to the final location.
- During the animation, we translate all launcher content
  down
- When the x/y springs, and rect animator all finish,
  we use a spring to bounce the launcher content back up

- Added AppCloseConfig so that the entire animation can
  be defined in one location, with getter methods so that
  all the involved parties of the animation can access the
  current value.
- The animations are all defined linearly, and then
  interpolated over using a 3 point curve.

Building behind feature flag as we tune the values.

Bug: 173107751
Test: manual, visual
Change-Id: I83ad0fa2c4234cf30004240d43e191354595adc8
2021-04-22 16:11:11 -04:00
Adam Cohen
6adae06ed2 Merge "Update drag and drop visualizations" into sc-dev 2021-04-16 18:06:54 +00:00
Adam Cohen
f7ca3b4e3f Update drag and drop visualizations
=> Remove the bitmap-based icon outline
=> Add simple cell based location preview of drop location
=> Round corners of page outlines
=> Get rid of page background for focused page
=> Update colors to use system accent color

Bug: 185163323

Test: manual

Change-Id: Id604c59201536967e25236f305eeeb0aafc9c022
2021-04-15 12:45:24 -07:00
Tony Wickham
01320be908 Fix regression where StaggeredWorkspaceAnim didn't respect animateScrim
Before, this happened to work because we skipped setting the scrim when
doing an atomic animation, but the atomic animation code has been
removed. Add an explicit SKIP_SCRIM config flag instead.

Test: swipe up from overview to home, ensure scrim animates nicely

Bug: 185411781
Change-Id: I7bc14a11d9d416cc7336ea29d21107dcdbdbf782
2021-04-14 14:54:44 -07:00
Sunny Goyal
c82916fecb Some cleanup in RecentsView
> Merging overview and all-apps scrims into a single View
> Decoupling TaskMenuView from taskView

Bug: 184676497
Test: Manual

Change-Id: I49f7249eaa2a800054385ab8e73a441d6a1b5e16
2021-04-06 15:47:33 -07:00
Tony Wickham
6cd95cd2d8 Remove Overview atomic animation support
- Remove PLAY_ATOMIC_OVERVIEW_SCALE and PLAY_ATOMIC_OVERVIEW_PEEK
- Remove complicated parallel atomic animation support from
  AbstractStateChangeTouchController and subclasses
- Remove some code related to going between Overview <-> AllApps

Test: Swipe between states in all 3 navigation modes
Bug: 175137718
Change-Id: Ice314d46946c3a983cdc6ccf1a67effb5da9156e
2021-03-29 11:59:06 -07:00
Tony Wickham
11bc3118c9 Merge "Remove dead taskbar code" into sc-dev 2021-03-24 17:20:18 +00:00
TreeHugger Robot
b9d201a5d6 Merge "Remove some unused hotseat/qsb scaling code" into sc-dev 2021-03-24 00:16:01 +00:00
Tony Wickham
e63bd38a55 Remove dead taskbar code
Test: Works as before
Bug: 182512211
Change-Id: Id4c979f2924f9ae6881a9bed18bcc52fbd80c05b
2021-03-23 11:42:50 -07:00
Tony Wickham
d0b6bfaa69 Remove some unused hotseat/qsb scaling code
Now that QSB is always part of Hotseat, we don't need
getQsbScaleAndTranslation(), and now that HOTSEAT_ICONS are never in
Overview, we can remove the getHotseatScaleAndTranslation() override

Test: Everything works as before
Bug: 175137718
Change-Id: I902815d8e270269c1a2a9af54fa8480e5aef929d
2021-03-23 10:33:44 -07:00
Tony Wickham
9ce3b25ef6 Add TaskbarView as a child of Hotseat
Instead of keeping the Taskbar window showing above the home screen,
we now integrate a copy of TaskbarView directly into Launcher's view
hierarchy. Most TaskbarController calls apply to both TaskbarViews
(mTaskbarViewInApp and mTaskbarViewOnHome), except for calls related
to Hotseat, which only apply to mTasbkarViewInApp given the real
Hotseat will be showing with mTaskbarViewOnHome.

More cleanup will follow this change.

Test: All taskbar interactions (e.g. drag and drop) continue to work
Bug: 182512211
Bug: 171917176
Change-Id: I0f0b124f652daa85f866e1df8f9e2981540331a0
2021-03-22 15:26:01 -07:00
Sunny Goyal
c373e1c642 Adding an optional QSB in hotseat
Removing sections in all-apps during transition and treating
it as a single unit

Bug: 175137718
Test: Manual
Change-Id: I55a501d80b5903f1a9d92a26b3784784fd9e50fd
2021-03-17 12:21:44 -07:00
Tony Wickham
ae72b46b2c Replace taskbar hotseat with real hotseat when folder is open
- Seamlessly show real hotseat and hide taskbar hotseat, while
  keeping rest of taskbar visible
- Update MultiValueAlpha to allow for taking max alpha instead
  of blending, and use that for Hotseat
- Fix folder open bounds on home screen when taskbar is present

Test: Open folder from taskbar on home, can drag out items
Bug: 182079330
Bug: 171917176
Change-Id: I7c1983e3219b1341cf233260f0ccac9051c4dc14
2021-03-12 11:05:43 -08:00
Tony Wickham
a29a046d83 Align real hotseat with taskbar hotseat during drag and drop
Remove hotseat space from workspace in DeviceProfile if
taskbar is present, and instantly swap between taskbar and
hotseat when entering SpringLoadedMode. To allow for an exact
handoff, we also scale up the TaskbarView such that its icons
match the hotseat icon size when on the home screen.

Note that this CL only supports dragging to the taskbar, not
out of it (which still triggers system drag and drop instead).

Test: In RTL and LTR, drag a workspace item and ensure hotseat
seamlessly swaps with the taskbar hotseat and allows drops.

Bug: 179886115
Bug: 171917176

Change-Id: Id6462075b9b0b66b06d51a78c9c0b3e11e83e84d
2021-03-03 11:16:42 -08:00
Adam Cohen
501e139c6e Draw the workspace scrim in the LauncherRootView instead of DragLayer
=> The entire DragLayer is translated during the -1 transition which creates a janky looking edge at the top of the screen

=> By bumping the scrim up a level, we avoid this

=> Separated WorkspaceAndHotseatScrim into two separate scrims, since only part of the scrim needed to be bumped up to a level. Further, it was an overloaded class.

=> We had previously been implicitly relying on the fact that the scrim was rendered in the Workspace parent; we need to make sure to propagate workspace inavlidations to the container of the scrim. While things would still work without this change, it's more correct to leave it, as we no longer assume a hierarchy for functinoality.

Bug: 178215332

Test: manual verification. See video in bug.

Change-Id: I0a76ddf35ceea8c9635367f69380ef24f42e9479
2021-02-10 19:16:26 +00:00
Jon Miranda
271638574f Add spring to workspace scale when going from Hint state to Normal state.
Bug: 151768994
Change-Id: If03d39e5ef6319355a7691d60fc0152de2fc3cec
2020-06-18 17:53:07 -07:00
Sunny Goyal
35e7d38681 Abstracting out state handler logic into base classes so that it can
also be used in different activity

Change-Id: Ic5e60b21e1429c71f1cd4e7041e70bf4fc9761b7
2020-05-11 16:38:26 -07:00
Sunny Goyal
8f96546e79 Generalizing LauncherState definition so that it can be used in RecentsActivity
> Removing 'Launcher' as parameter from state methods called by StateManager
> Converting state properties to methods for easier abstraction
> Moving state handling drom state definition to activity class

Change-Id: I997627df606a7e0bb3bf32688d045a942a47fc94
2020-04-30 01:01:51 -07:00
Sunny Goyal
c4d3201538 Removing support for fake landscape
Bug: 111068105
Change-Id: If31d2f700ddee1d21541735de3a8006ee2a53c5c
2020-04-03 17:11:35 -07:00
Sunny Goyal
f3ac703256 Moving animation config so a separate class
Using PendingAnimation for animation builder.
This will allow us to easily add SpringAnimation to stateAnimation

Change-Id: I8d88489a5da6fc85747ef9be7c13858b441cd28a
2020-03-16 19:36:36 -07:00
Tony Wickham
984c01cbcd Invert playNonAtomicComponent() as onlyPlayAtomicComponent()
This avoids the double negative we use in a few places, so should be clearer.
Also added some comments to explain what the animComponents are used for.

Change-Id: Ibd25bd12efce6553b377bbd9c0651e4f4ac3e498
2020-03-11 18:21:53 -07:00
Sunny Goyal
dbcc63edeb Removing some autoboxing during property animation
Change-Id: Ibd6f20c565a4d66dc6d606b3f0bbc96fec66fe56
2020-03-10 08:43:55 +00:00
Tony Wickham
4fdba14cfb Two-zone model: swipe up from nav bar vs above it
When ENABLE_OVERVIEW_ACTIONS flag is enabled, swiping up from the nav
bar goes to overview if you hold, or the first home screen if you don't.

- Added NoButtonNavBarToOverviewTouchController, which extends
  FlingAndHoldTouchController but only works if you start from the nav
  bar. Otherwise it falls back to PortraitStatesTouchController to
  handle normal state transition to all apps.
- Added HintState. This is where the workspace/hotseat/qsb scale down
  when you swipe up from the nav bar, to hint that you're about to
  either go to overview or the first home screen.
  - Added getQsbScaleAndTranslation() to allow Overview and Hint states
    to treat it as part of the hotseat.
  - Since Overview needs to show above the QSB as it's animating, bring
    Overview to the front and update OverviewScrim to handle the case
    where there's no view above Overview to draw the scrim beneath.
- ENABLE_OVERVIEW_ACTIONS is always false in 2-button mode, since the
  shelf is crucial to that mode.

Bug: 143361609
Change-Id: I743481bb239dc77f7024dc98ba68a43534da2637
2020-01-28 18:31:10 -08:00
Sunny Goyal
37279e2313 Scaling down hotseat to match prediction row size when going to overview
Bug: 141265005
Change-Id: I3b11146881af334508f553e4ca3a36b9291511d9
2019-11-06 14:39:28 -08:00
Tony Wickham
59c6901823 Some improvements to home to overview transition for 0 button mode
- Peek in overview further, and with more overshoot
- Fade out and scale down workspace faster while swiping up
- Scale and translate workspace slower when letting go to enter
  overview (so it doesn't zoom out at warp speed)
- Fade in all apps shelf sooner

Bug: 132455160
Change-Id: Ieafad0ccf9bb587889bc35d536627661db10e358
2019-06-19 14:48:57 -07:00
Tony
ae087dc9b8 Fade out scrim when swiping to home
Bug: 134517106
Change-Id: Ica725e3a327c1c069e3859732ea6a878d361a3d8
2019-06-04 19:25:03 -07:00
Sunny Goyal
ae6e318711 Initial changes to creating a fake landscape Launcher UI
Workspace and hotseat are drawn in rotated UI giving the impression that the
device is in Portrait, even though it is in landscape

Bug: 131360075
Change-Id: I29c4068af25fd4dcf7039b9a45886e864a137977
2019-05-02 10:59:28 -07:00
Tony
e4c2e2b86c Add QuickSwitchTouchController on home
- Added QuickSwitchState, which we animate to when swiping right
  on the nav bar from NORMAL state
- Task launches when the state transition to QuickSwitchState ends

Bug: 126596417
Change-Id: Id66650401d817703fc6d044fb26a25cccbc07e11
2019-03-28 15:09:25 -05:00
Tony
1787ee9596 Peek overview on motion pause, then animate fully on touch up
Add AnimationComponents.ATOMIC_OVERVIEW_PEEK_COMPONENT, and rename
previous ATOMIC_COMPONENT to ATOMIC_OVERVIEW_SCALE_COMPONENT.

When SWIPE_HOME is enabled:
- Overview lives to the left of Workspace, which is encoded in
  LauncherState.NORMAL.getOverviewScaleAndTranslation().
- Create atomic animation based on ATOMIC_OVERVIEW_PEEK_COMPONENT
  and OVERVIEW_PEEK state when swiping and holding from home screen.

Bug: 111926330
Change-Id: Iab6dbef7238dae15b3036d4b2a026b781eee6b4b
2019-03-27 19:45:04 -05:00
Tony
2ed8936da1 Fix translationX that should be translationY
Change-Id: Ie1dc8b327a312d206050926ea9f5572113727c57
2019-03-27 17:03:00 -05:00
Tony
bc23440d73 Add translationX to overview state
States return ScaleAndTranslation instead of float[].

Also separate overview translate interpolator from overview scale interpolator.

Change-Id: I5e65dde3f436055ff5e7f5736f1a4b712377b9cb
2019-03-27 14:36:48 -05:00
Tony Wickham
57e489c8b5 Fix hotseat translated upwards when dragging from all apps
Before, we just didn't scale or translate when entering spring loaded
state. That worked when dragging from home, but when dragging from all
apps it meant that the hotseat kept its translation from the transition
to all apps. Now we always move the hotseat to scale 1 and translation 0
when going to spring loaded mode.

Change-Id: I0630d5bb899e37e2ab01516adfc1b7e6f8a9e42a
2019-03-04 14:57:07 -08:00
Tony
4bb4b89b9a Scale and translate hotseat with workspace instead of all apps
- Move the hotseat alongside workspace instead of on top of all apps in xml layout
- Set pivot point of hotseat to match the workspace's, and apply the same scale
- Translate the hotseat with the workspace instead of all apps
- SpringLoadedState does not scale or translate the hotseat

Change-Id: Ic45fe99f83f0e0012afa78073d9577e65da444e2
2019-03-03 15:43:50 -08:00
Sunny Goyal
876e462ffa Removing separate hotseat widget, instead using a QSB acroll all UI.
The QSB is responsible for updating its UI according to various states.

Bug: 109828640
Change-Id: Ic8cbf3d404d5870de0f6b8fe25a332b8d21bae20
2018-11-05 13:36:41 -08:00