Commit Graph

261 Commits

Author SHA1 Message Date
Steven Ng
7e31e9b267 Modify AT_LEAST_S check to include SDK int
BuildCompat.isAtLeastS() in Launcher dependency only checks if the
code name is "S". In the recent version of Android, the code name has
changed to "REL".

Test: Open Widgets picker, expand Conversations and observe a preview
      layout is shown.
Fix: 191239040, 191216821
Change-Id: I6a6e647d4cb327d251bde3484ea2d2e79c0f86f5
2021-06-16 23:56:38 +01:00
Cyrus Boadway
9f06168692 Use the splash screen background color as the fallback background color
For the widget transition animation fallback background color, use either
the splash screen background color if a task is starting or the task
description-attached background color.

With a background in place, allow the window to fully fade out before
fading in the widget, by moving the window alpha math into an animation
factory-specific implementation.

Bug: 187706750
Test: Manual
Change-Id: I2b5a7783b0585d447ad60534bc48d2e2176877ed
2021-06-10 21:03:24 +00:00
Sunny Goyal
e9d27f137f Updating method for getting themed icon
Bug: 183641907
Test: Manual
Change-Id: I417886acea1b518c184d8e7c649367cae841a7e4
2021-05-21 12:29:15 -07:00
Sunny Goyal
d5500548dc Revert^2 "Moving taskbar lifecycle to TouchInteractionService"
430465a3d5
Bug: 187353581
Change-Id: I7b2280d16adfafd3e85ffc1d22e32d0c00d12b67
2021-05-21 07:05:02 +00:00
Kholoud Mohamed
430465a3d5 Revert "Moving taskbar lifecycle to TouchInteractionService"
This reverts commit e215fb730b.

Reason for revert: DroidMonitor-triggered revert due to breakage https://android-build.googleplex.com/builds/tests/view?invocationId=I13700009003387451&testResultId=TR89423459137251402, bug https://buganizer.corp.google.com/issues/188755902

Bug: 188755902
Change-Id: I4650136975b60f311499ee6ff5b27ab9a32d23d6
2021-05-20 13:32:05 +01:00
Sunny Goyal
e215fb730b Moving taskbar lifecycle to TouchInteractionService
> Inflating taskbar views with a non-launcher window context
> Removing separate taskbar view in Launcher
> Handling taskbar icon clicks directly instead of going via launcher
> Fixing some relayouts during show/hide animation

Bug: 187353581
Test: Manual
Change-Id: Ia7d44acbb770bf0345922234b3daa5cc040a5843
2021-05-17 21:47:08 -07:00
Jon Miranda
af3aed0c4a Use SP for folder text size.
Bug: 156141463
Test: change font size, verify folder text size changes
Change-Id: I7e479d76c9f16c5b42cabfbae63494ef98b6dc27
2021-05-11 16:14:09 -07:00
Sunny Goyal
b47172bc4e Linking various settings that control icon cache to icon state
Also separating icon provider for recents from Launcher as it used a fixed size

Bug: 183641907
Test: Verified on device
Change-Id: I6ea3caa0066d1483bfb8a81f0e8aaa472c813afe
2021-05-05 23:05:38 -07:00
Jon Miranda
88b7f6a0d5 Move color extraction utils to extractor class so each instance can
have its own set of temp variables.

- Pass in float[] param to not create new obj in each frame
  for dragging widget case.

Bug: 175329686
Bug: 187019711
Test: manual, verify
Change-Id: I4350fb7e66a80c73def5659fb41abc14d357e667
2021-05-04 09:00:01 -07:00
Jonathan Miranda
21930da9a2 Revert "Revert "Use color extraction for arrow popup.""
This reverts commit 17fda29bf3.

Reason for revert: Fixing the memory leak

Leak was detected in caused launcher tapl tests to fail.
For instructions on how to debug leaks, see go/launcher-testing.
Using AS memory profiler, the color extractor class is holding
onto a reference to launcher that has already been destroyed.
The fix is to set the listener to null when view is closed.

Bug: 175329686
Test: run profiler in AS, open and close popups, and verify no leaks

Change-Id: I2d4a87f0481cbc88f3587dce91278e85ca113545
2021-05-04 08:53:58 -07:00
Sunny Goyal
9ab43772ab Adding support for using themed icons on workspace
Bug: 183641907
Test: Manual

Change-Id: Ieda7e73b3ae4dfe3009e3f23754aff5f8826a967
2021-05-03 20:00:38 -07:00
Vadim Tryshev
17fda29bf3 Revert "Use color extraction for arrow popup."
This reverts commit 242c805f82.

Reason for revert: Introduces a leak. I haven't seen a bug for it yet, but this CL is the only in the culprit list; the leak can block multiple teams presubmits, and the leak is via ArrowPopup. Enough evidence.
https://fusion2.corp.google.com/invocations/4b50db71-d598-4e52-9076-e91d42b65014/targets

Change-Id: I1700a9eea8705983598aee43c0a63e67c1d9cf71
Bug: 187075409
2021-05-03 18:27:41 +00:00
Jon Miranda
242c805f82 Use color extraction for arrow popup.
- Updated logic to accept any view that is a a child of draglayer
  (from being workspace dependent)
- Move color extraction logic from widget class to utility class.
- Initial CL, future CL will interpolate between colors
  and expand color extraction to other abstract floating views.

Bug: 175329686
Test: long press on colorful wallpaper and test colors are extracted
      test in multiwindow mode
Change-Id: I18a6bb5013de4eea7e9b45810401f5b9b3cd7302
2021-04-30 15:54:17 -07:00
Vinit Nayak
4cc0dbb552 Change TaskIconMenu to lay out vertically
Still lays out horizontally when in phone
landscape.
TODO(b/186583656), need to center view.
Also have all layout be dynamic instead of having
some cases be in XML and some in code.

Bug: 181704764
Test: Task menu visible with all options in
portrait/landscape tablet
portrait phone
fake/real landscape phone

Change-Id: I3632eeb174f3e4baf2c9d69d51c1815c3c512e59
2021-04-28 11:47:08 -07:00
Sunny Goyal
35c7b19fa8 Using WindowContext for listening to configuration changes
Pre-S: Continue to use config-changed broadcast for configuration changes
and display-changed event for rotation changes
S+: Use WindowContext#componentCallbacks for config and rotation changes, and
continue to use display listener for frame-rate changes

Bug: 179308296
Test: Manual and presubmit
Change-Id: I533e69068b5fa6c052a02759ef309dd075ee6a4b
2021-04-22 00:23:02 -07:00
Sunny Goyal
9f2acdd552 Unifying icon loading methods
Bug: 183641907
Test: Presubmit
Change-Id: I255e81a128635910b531b3d00f707fa352050f2e
2021-04-15 16:48:04 -07:00
Zak Cohen
ec4407b4ef Overview - add the ability to color scrim task views.
Bug: 184202238
Test: local build and flash
Change-Id: If700cb6dffc3966fe860c40d98d40a5899c236e4
2021-04-05 11:17:02 -07:00
Sunny Goyal
572aca4ce2 Moving some common functionality to IconLoaderLib
Bug: 183641907
Test: Manual
Change-Id: Icfc7ebb140e4e1678b0715beee2e0e513e707b9e
2021-03-25 10:06:53 -07:00
[1;3C
a608d81359 Add rotation support to launch animations
This only adds support for launch animations. Recents
requires some auxiliar work.

Adds a rotation parameter to the animation targets that
only gets used by shell transitions. If this is non-zero,
launcher will transform it's coordinates relative to that
provide rotation.

Bug: 179308296
Test: Launch and exit apps with different orientation from
      default (portrait).
Change-Id: I7b52cbd37432bcd43e7155bcb07b30cc65c43186
2021-03-17 15:30:47 -07:00
Pat Manning
0fe7326cf0 Align task thumbnails to edge when cropped.
Align to left edge unless RTL enabled. Do not rotate thumbnails if they
would not fit nicely once rotated.

Test: manual - Ensure task thumbnails align with left edge if cropped.
Bug: 177402412
Change-Id: I6e03715061120deb5a8fde005d676170eed0f819
2021-03-17 01:30:07 +00:00
Sunny Goyal
4c23ca768f Fixing shortcut intent getting cleared during backup/restore
Bug: 174570283
Bug: 156871815
Test: Verified on device
Change-Id: Ie286ee783bfe96c5b2be28f0db5298caf3801e6d
2021-02-12 18:04:23 +00:00
Tracy Zhou
0455d146a1 Fix missing grid for devices that upgrade from R
Fixes: 178435615
Test: TODO
Change-Id: I9894b88485daf5b641b4674a5abff05e0f53138b
2021-01-27 22:18:13 +00:00
Sunny Goyal
6638b56667 Merge "Preventing crash when a gesture starts after home activity change but before the update has been received by Launcher" 2021-01-19 18:04:20 +00:00
Sunny Goyal
53e3b14029 Preventing crash when a gesture starts after home activity change but
before the update has been received by Launcher

Bug: 175645691
Test: Verified using a test launcher
Change-Id: I3f726894bdc941878bb8f8eba7c4701e1218c0dd
2021-01-13 16:21:02 -08:00
Schneider Victor-tulias
6a5f431a7b Revert "Revert "Add UI updates for incremental app installs.""
This reverts commit 229497d182.

Reason for revert: Patching bugs

Fixes: 176901235, 176992421, 176884453

Test: manual

Change-Id: I57e13a15e72284564a10761966732ee31d15fd08
2021-01-12 12:22:33 -08:00
Schneider Victor-tulias
229497d182 Revert "Add UI updates for incremental app installs."
This reverts commit 84269d349d.

Reason for revert: causes b/176884453 and b/176992421

Change-Id: I3398674a0acbad8329df5d341ae074ac073a6bf9
2021-01-07 19:44:44 +00:00
Schneider Victor-tulias
84269d349d Add UI updates for incremental app installs.
1. Changed Preload Icon UI to be grayscale while the app is not startable.
2. Added progress bar for when app is installed but still ownloading.
3. Updated Preload Icon progress and click handling to use new incremental api.

Progress bar color updates will follow in a separate CL.

Demo: https://drive.google.com/file/d/1H1EvtTorLeJwC1eiq10tm-TT81YZ6osk/view?usp=sharing

Bug: 171008815

Test: manual

Change-Id: I5874a5146d79a8c91d7d90ff0b9c1c427a3c95dd
2021-01-05 15:17:26 -05:00
Schneider Victor-tulias
20bbaa3390 Add additional fake task views on overview gesture completion.
Added motion pause listening to animate an additional fake task view on overview gestures in the sandbox.

Test: manual

Demo: https://drive.google.com/file/d/1EpewbIAxiMUEz0Fqdfbok5q9xpWS6NWz/view?usp=sharing
Change-Id: Ifd0aed0a2bbb3204ae32c833b8466952679700e3
2020-12-22 16:10:09 -08:00
Sunny Goyal
733e3c609b Moving some initializations to the background thread
HandlerThread.getLooper blocks until the thread is ready. Instead
moving all looper dependency to the new thread itself.

Change-Id: I240e8c56b855a991433a7fe93875059e6dab146b
2020-10-02 10:58:27 -07:00
Wesley.CW Wang
e5cbe2fc9a Add intent extra when launching WallpaperPicker from Launcher am: 0f5c9dbb6f
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/12536777

Change-Id: I83bd42ebc449e9e91c73e1c1228ca81b487637ed
2020-09-22 13:52:18 +00:00
Wesley.CW Wang
0f5c9dbb6f Add intent extra when launching WallpaperPicker from Launcher
- Add extra to the intent to help WallpaperPicker log the launch
 source
 - design doc: go/log-wppg-launch-source

Bug: 154781896
Test: manually
Change-Id: Ife774866b06251c01f28f72555c3dcc844fdc051
2020-09-22 13:13:35 +00:00
Sunny Goyal
53116c6cc8 Simplifying InstallShortcutReceiver
> Removing support for legacy shortcuts (with embedded icon)
> Unifying pattern for storing the data in prefs

Change-Id: Ife250807c7ce5337969d25444ee23c751bc2a487
2020-08-11 16:41:45 -07:00
Sunny Goyal
eaf7a95546 Changing minimum supported Launcher version to 26
Change-Id: I49fcf874430ac53c3246371e179fbd828e14e4da
2020-07-29 17:30:19 -07:00
Samuel Fufa
adbe9b6075 ADD NPE check before shortcut key creation.
Bug: 156871815
Change-Id: I88132a51f80062eaa76da5838d20c5fe93224635
2020-06-11 15:15:02 -07:00
Sunny Goyal
0addbf0512 Various multi-window fixes
> Fixing scale up calculator for swipe-down
> Offsetting pivot so that the preview is aligned to bottom-right
> Allowing insets to be available in multi-window mode as well
> Offsetting taskViewSimulator appropriately in multi-window mode

Change-Id: I7da4c145efca72ef219a5ffcaf23d726812df270
2020-04-29 11:50:33 -07:00
Tracy Zhou
df5d99f419 Merge "Refactor usage of getting GRID_OPTIONS_PREFERENCE_KEY value into whether GridOptionsProvider is enabled" into ub-launcher3-rvc-dev 2020-04-28 22:26:46 +00:00
Tracy Zhou
c6060e6e2a Refactor usage of getting GRID_OPTIONS_PREFERENCE_KEY value into whether GridOptionsProvider is enabled
Bug: 154154093
Test: manual testing of the feature
Change-Id: Ibe78a75b061aad20e8fa0e229589400b65016ff4
2020-04-28 14:02:49 -07:00
Zak Cohen
a39544d562 OverviewActions - Use launcher state to track modal state.
Test:local

Change-Id: I44e25b95095b9a7aac4b4172c9c91fbfbf4d9ec7
2020-04-27 16:29:44 -07:00
Sunny Goyal
e396abf502 Moving model data structures to a separate file
Change-Id: I77ad7a5219e72d2e0d6c1803de2ac3ed6a65a8f7
2020-04-09 13:20:39 -07:00
Sunny Goyal
c4d3201538 Removing support for fake landscape
Bug: 111068105
Change-Id: If31d2f700ddee1d21541735de3a8006ee2a53c5c
2020-04-03 17:11:35 -07:00
Vinit Nayak
b9ec9319c5 Add fixed_rotation_transform to home settings
This sets the feature flag on launcher side
and also updates the setting in Settings.Global
Launcher DOES NOT listen to the Settings.Global
change from adb anymore. This should take
preference over setting it from command line.

Also fix a related swipe to home animation bug
that happened w/ merge conflict.

Fixes: 150260456
Test: Set and unset, visually verified behavior.
Tested w/ autorotate on and off.
Checked Settings.Global value correctly updated
via "adb shell settings get global
fixed_rotation_transform"
TODO: Update tests to reflect this new
default-on fixed rotation behavior.

Change-Id: Id95f006eb1e92a59e24b05567298fd21b1409b13
2020-03-11 19:38:33 -07:00
Vinit Nayak
a406f727ad Add vertical layout support for Overview in portrait
WM is making changes which allows apps to maintain
their orientation independent of the orientation of
the foreground app. This allows recents to always start
in portrait even when the app currently running is in
landscape. This means we have to give the illusion of
a landscape oriented overview when user swipes up in
gesterual nav when launcher is started in portrait
configuration.

PagedOrientationHandler abstracts all coordinate specific
logic from Paged/RecentsView primarily, but also all
other dynamic calculations throughout launcher.
PagedViewOrientationState is the single point of exposure
to other classes that depend on those changes. The goal
is to also minimize holding state to allow for default
implementations of PagedOrientationHandler for all the
3p/Fallback classes. PagedViewOrientationState also
holds other data around rotation that isn't
specifically tied to view logic.

The fake landscape overview can be toggled with:
adb shell settings put global forced_rotation [0/1]

Fixes: 146176182
Change-Id: I65d8d4e9f92b93931cbe0053ccaf0cda8d2ffd6c
2020-03-02 18:02:35 -08:00
Sunny Goyal
18204e4eea Various icon cache fixes
> Multiple instances of LauncherIcon created when
    LauncherIcons refers IconCache which in turn creates new LauncherIcons
> Widget icons are never cached as they were using low res icons
> Shortcut drag icons are not loaded synchronously
    when using PinItemRequest flow
> Wrong lastUpdatedTime is used in iconCache for shortcuts
> IconUpdateHandler does not ignore managedUser promise icons

Change-Id: Ie7eed68a30fad11d1861b6c70c380953a15ae1cf
2020-02-06 14:16:34 -08:00
TreeHugger Robot
0618d689e8 Merge changes from topic "state-supplier" into ub-launcher3-master
* changes:
  Translate recents slightly while dragging after pausing
  Two-zone model: swipe up from nav bar vs above it
  Change LauncherState to Supplier<LauncherState> in tests
2020-01-29 03:06:04 +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
09b03c55df Optimizing some slow calls on the main thread
Change-Id: I4eed5f7e5bf1316556d6985a610918fc709a7471
2020-01-28 22:18:14 +00:00
Sunny Goyal
fa39536570 Removing static reference of deep shortcut manager
Bug: 141376165
Change-Id: Ie60b82be63a8926825598c681d8b2a1b2ace6413
2020-01-02 20:13:12 +00:00
Samuel Fufa
306177c14e Fix dragging icon badge offset
am: 37b2489ff7

Change-Id: Ibe7dbed4d3880086da14692597341ea9487efc29
2019-11-05 18:53:46 -08:00
Samuel Fufa
37b2489ff7 Fix dragging icon badge offset
Bug: 143702640
Test: Manual
Change-Id: I86d97c1f0ea02c86f4bf745a8bdda3887c62f27e
2019-11-05 15:29:22 -08:00
Sunny Goyal
14168431bd Adding support for dynamic calendar and clock icons
Change-Id: Icdba34340a27a4f6dff7310d0bf9fd29aef1330c
2019-10-29 13:50:02 -07:00