Commit Graph

138 Commits

Author SHA1 Message Date
Pat Manning
b53d8d6360 Fix focus navigation of All Apps when using external keyboard.
- All apps icons do not show the focus rectangle when focused as mIconFocusListener is null in BaseAllAppsAdapter when onCreateViewHolder is called.
- All apps recyclerview does not scroll down when focus goes from top to bottom of list, as AllAppsToastUiDelegate calls hideKeyboard which clears focus.
- Focus goes behind AllApps into hotseat, so update hotseat setDescendantFocusability.

Flag: NONE
Fix: 296844600
Test: TaplKeyboardFocusTest
Change-Id: I65f6fbb6f4df0be4b4ff922dda267d27da16effe
2023-10-31 13:47:12 +00:00
Sebastian Franco
9ea36d429c Adding animation so the CellLayout is properly spaced on Foldables
Flag: LEGACY FOLDABLE_SINGLE_PAGE DISABLED
Fix: 294841331
Test: atest HomeScreenEditStateImageTest
Change-Id: I5dc94b63ca322748b952ce4bd55b6951d51d190f
2023-10-20 13:59:40 -07:00
Andy Wickham
a3808a8e33 Merge "Revert "Switch ScrimView to use view alpha"" into udc-qpr-dev 2023-06-20 17:04:42 +00:00
Andy Wickham
88dd86bda9 Revert "Switch ScrimView to use view alpha"
This reverts commit 99c4becf24.

Reason for revert: b/287488354

Change-Id: Ic4db08ca771f1d744ba2c19eb55b9f2d277ad529
2023-06-15 22:27:28 +00:00
Vadim Tryshev
544dff52af Merge "Switch ScrimView to use view alpha" into udc-qpr-dev 2023-06-07 21:47:59 +00:00
vadimt
99c4becf24 Switch ScrimView to use view alpha
Using view alpha instead of background paint’s color alpha component
will make ScrimView alpha and visibility available to View Capture and
any analysis tool that’s based on it.

The change makes ScimView background completely opaque, and makes Scrim
View use variable alpha instead of always-1.0 alpha.

Changes some code that depends on the old way of representing ScrimView
opacity.

Also moves “updateSysUiColors()” call in ScrimView#setBackgroundColor
below updating alpha and background color so the new values are used in
the calculations.

Bug: 282991128
Test: local, presubmit
Change-Id: I6ca089bae55adfb9c3140d06da4fbb3b08f2bf8b
2023-06-02 15:47:51 -07:00
Sunny Goyal
3e596d3aa4 Updating the top scrim to also use dynamicaly generated bitmap
Bug: 237818532
Test: Verified on device
Flag: N/A
Change-Id: I22ceb470677ab9df53e40fb78f0292b7fd5e2241
2023-06-01 19:20:04 +00:00
Kateryna Ivanova
7120373bbc Migrate Interpolators from Launcher3 to the public animation library
Test: atest
Bug: 271850966
Change-Id: Iba999f2e753764a37d35e508e707df02388432e9
2023-05-30 07:20:38 +00:00
Charlie Anderson
438d405aab Adding a new Edit Mode LauncherState
- Edit Mode doesn't close after dragging / dropping an app
	- Edit Mode can be entered through options popup menu, Spring Loaded still entered by dragging items
	- Adds new onLeavingState call to launcher states to cleanup changes

Bug: 279590398
Flag: MULTI_SELECT_EDIT_MODE
Test: manually tested the new state with flag on/off

Change-Id: If4550037f9659dcb8cd8b1943388d1ec5d55fa29
2023-05-12 14:54:45 -04:00
fbaron
e74256bba8 Remove unused code for old mult select design
We previously made a few CL's guarded under flags for the multi select feature. We ended up having to halt progress on this, and now that we're starting again, the design is different and we are using a new flag. Here we get rid of the unused code and flags

Bug: 277617038
Test: Verify everything still works normally, everything was guarded under flags that were off so there shouldn't be any changes
Change-Id: I2f57d1f67aa2a8cf83287f6f3df9fa6c46dbf0ab
2023-04-10 14:55:41 -07:00
Sunny Goyal
5cd1b198b0 Revert "Revert "Revert "Simplifying some page indicator dots attributes so that it can"""
This reverts commit 7025765c72.

Reason for revert: 274169859

Change-Id: I86a114bf2c713fea6ec7095f68816820ba5f7495
2023-04-06 22:33:11 +00:00
Sunny Goyal
7025765c72 Revert "Revert "Simplifying some page indicator dots attributes so that it can""
This reverts commit 0263a679f2.

Reason for revert: Trying again to confirm if this was the actual cause of regression

Change-Id: I2a663015d7ecdcf315634d8a976bf8294b58981d
2023-03-31 17:10:15 +00:00
Sunny Goyal
0263a679f2 Revert "Simplifying some page indicator dots attributes so that it can"
This reverts commit a5ead45967.

Reason for revert: b/274169859

Change-Id: Id214694ae4f61cd70796c6f7e932c1fdef82d746
2023-03-29 19:11:03 +00:00
Sunny Goyal
a5ead45967 Simplifying some page indicator dots attributes so that it can
be easily modularized

> Moving the color configuration to xml
> Moving auto-hide logic to a subclass as it doesn't
  need to be in the main library

Bug: 274011949
Test: Verified on device
Change-Id: Icf7bd5d1cbde3daa9441f2af51f98a931bcd6ee2
2023-03-16 15:57:06 -07:00
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