Commit Graph

252 Commits

Author SHA1 Message Date
Jon Miranda
fe74997235 Fix NPE in BubbleTextView
- Icon can be null when we use BTV for text only

Bug: 223809081
Test: manual
Change-Id: I9efd8e4b420127beb249b20e71ae37c359bb6467
2022-03-15 10:02:39 -07:00
Andy Wickham
56be73be80 Utilities.trim never returns null.
This fixes a crash loop I was seeing on my device and also
preemptively fixes similar NullPointerExceptions.

Bug: 213931730
Test: Manually verified crash loop stopped with this change.
Change-Id: I8d2fc8475d42ac60b7fdc9219421a8c9733c7b9f
2022-01-18 09:13:43 -08:00
Sunny Goyal
331e6e94f9 Merge "Updating icon badging logic" 2021-12-03 02:14:42 +00:00
Sunny Goyal
d872a97bd0 Updating icon badging logic
Bug: 201682172
Test: Manual
Change-Id: I57421b0c77e12f1cd464e532d2a1383c2cf93981
2021-12-02 22:14:25 +00:00
Schneider Victor-tulias
bdb0dd8cfb Refactor LauncherAccessibilityDelegate so it can be used outside of Launcher
Bug: 198438631
Test: used talkback on launcher
Change-Id: I991320184ad93816c4ba21fb8fcfe12202bfae25
2021-11-23 12:48:14 -08:00
TreeHugger Robot
903065a490 Merge "Fix wrong getIconBounds method inside BubbleTextView" into sc-v2-dev am: 31bd663332 am: c1d0a5a6fb
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/16186109

Change-Id: If8a2b62b5f1166dd53905482c3ef139e4801b550
2021-11-10 10:09:58 +00:00
Hyunyoung Song
c2f024beb6 Fix wrong getIconBounds method inside BubbleTextView
Bug: 205065809
Test: screenshot on the bug

TL;DR;; created two variants depending on the layout direction

Change-Id: I9c5e74409c701b1f219ca450de0dca2291507045
2021-11-09 11:39:21 -08:00
Rajeev Kumar
5cc195f449 Merge "P2P App Sharing: Gray out disabled SystemShortcut" 2021-10-29 22:32:44 +00:00
Jon Spivack
688621498a P2P App Sharing: Gray out disabled SystemShortcut
The Share App system shortcut is disabled for apps that are deemed unshareable. This updates the UX to gray out the shortcut instead of hiding it. When the user clicks on the grayed out shortcut, a Toast message is displayed. This update also enables the shareability check.

In order to properly gray out the shortcut, this also fixes a bug with BubbleTextView in which ColorStateLists weren't applied correctly.

Bug: 202556634
Bug: 204495363
Test: Manual (observed UX on Wembley device in regular and dark themes)
Test: m -j RunLauncherGoGoogleRoboTests
Change-Id: Ieb04baf8c9cb9d325119cb97fceb96f2fc5a62ff
2021-10-28 19:30:31 -07:00
Sunny Goyal
486adb03a0 Fixing wrong text spacing bounds
Bug: 203740844
Test: Manual
Change-Id: I68fcab489643acf80759f90736f806ae2852e648
2021-10-21 11:30:18 -07:00
Samuel Fufa
f0f2b75ada Merge "[Search] [Race condition] Fix wrong titles showing on BubbleTextHolder" into sc-v2-dev 2021-10-20 03:15:25 +00:00
sfufa@google.com
d7bdd97ac6 [Search] [Race condition] Fix wrong titles showing on BubbleTextHolder
No need to remove the listener on BubbleTextView#reset as BubbleTextView's parent should never change and always listen for ItemInfo updates.

Bug: 203506475
Test: Manual
Change-Id: Ie00b293495c79d36c9eb08408754389ab4b80839
2021-10-19 17:15:06 -07:00
Sunny Goyal
37a237b2cd Merge "Adding support for dynamic letter spacing for icon labels" into sc-v2-dev 2021-10-19 22:56:16 +00:00
Sunny Goyal
0d69cb6ef7 Adding support for dynamic letter spacing for icon labels
Bug: 201697936
Test: Manual
Change-Id: I0ab81291c40afcac30c5caf7b5638889908775f8
2021-10-19 13:09:58 -07:00
sfufa@google.com
0fe464ddb9 [Search] Fix ItemInfo assignment conflict
When a BubbleTextHolder has more than one bubble text view, BubbleTextView#getParent().onItemInfoChanged is problematic as the ItemInfo associated with the last BubbleTextView will be the final ItemInfo set on parent. This is fixed by setting ItemInfo change receiver more explicitly.

Bug: 203020679
Test: Manual
Change-Id: Ia8aeead1a6151c2aa47148ba4846ae3d3ee39b73
2021-10-14 14:35:08 -07:00
sfufa@google.com
ca76de0e6e Support drag/drop on search results
Bug: 199341710
Test: manual
Change-Id: I9879c2a3769d4f930ab0289d2f26e4757971549d
2021-10-04 13:14:12 -07:00
Steven Ng
707b118184 Use ICU to format plural strings
Test: manual
Fix: 199230208
Change-Id: I0b6fe9f8bb134a1479117c832575c63da2a07794
2021-09-17 22:44:06 +01:00
Nick Chameyev
4dd4159fdc Add taskbar icons unfold animation
Adds 'move from center' animation for taskbar icons when
unfolding foldable devices.

Moves unfold transition progress provider from quickstep
launcher activity to TouchInteractionService to widen
the scope when this provider is available to cover
both launcher activity and taskbar.

Launcher activity and taskbar get their own instances
of unfold transition progress provider using
ScopedUnfoldTransitionProgressProvider wrapper.
This wrapper allows to get transition progress provider
that emits events only when clients are ready to handle them.

Bug: 193794563
Test: manual
Change-Id: I27581bd4e145a74f526bf60f2a545e56ded322f9
2021-09-03 10:25:52 +01:00
Tony Wickham
42b0395fee Fix some taskbar stashing issues
- Don't allow long press to stash between taskbar icons
- Ensure taskbar_icon_touch_size is respected; previously it wasn't, because BubbleTextView@shouldIgnoreTouchDown() was returning true in the padding region. For taskbar, we want the whole icon size to be touchable.
- Cancel long press when passing touch slop to avoid swipe down being detected as long press

Test: long press on taskbar background, both between icons and not; swipe down on taskbar
Fixes: 198305464
Change-Id: I36f1d792e91da9a3bf57a2bef1e974b299c4e25c
2021-08-31 14:06:09 -07:00
Tony Wickham
175d152f76 Animate PredictedAppIcon when its icon changes
Reuses the slot machine animation to slide in the new icon. Additionally, staggers based on other icons changing before it.

Test: open apps, watch predictions change
Bug: 197780290
Change-Id: Ib2bc84193a9e350c915dd3486b6c98c6c88d3f83
2021-08-26 13:00:51 -07:00
Nick Chameyev
02c0c924a6 Merge "Add unfold animation to launcher icons and widgets" into sc-v2-dev 2021-08-11 18:04:03 +00:00
Nick Chameyev
5e8dbe77e8 Add unfold animation to launcher icons and widgets
Adds unfold animation to launcher which translates
icons and widgets from the center to the sides on
foldable devices.

Bug: 193794541
Test: manual
Change-Id: I9d6e018a0451d342f02dddea47bc180781c31d43
2021-08-11 16:10:18 +01:00
Sunny Goyal
59f1915c9d Using themed icons in taskbar
Bug: 195437559
Test: Verified on device
Change-Id: If8c0a72e037783e96abbaae6b60aa36a686fcfea
2021-08-03 12:25:22 -07:00
Hyunyoung Song
a2f87bef6e Merge "Icon sizes/ keyline / font for AA+ results" into sc-dev am: 02b62ed6fe
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/14837351

Change-Id: If8f00a4cb12d7942c0d582a45a43372ce89f030a
2021-06-07 15:09:47 +00:00
Hyunyoung Song
e3d32b543d Icon sizes/ keyline / font for AA+ results
Bug: 188946408
Bug: 189166362

Test: manual, screenshots on the bug
Change-Id: I40c77d8ea3cdcc9dcc33afb1026d1f75c21e9f05
2021-06-04 01:43:40 -07:00
Tony Wickham
f262591ab0 Merge changes I6bf48141,I77b7a2e4 into sc-v2-dev
* changes:
  Taskbar drag starts internal pre-drag before system drag
  Let DragView use ActivityContext instead of Launcher
2021-05-26 17:13:49 +00:00
Tony Wickham
8ac277ebd8 Taskbar drag starts internal pre-drag before system drag
- TaskbarDragController now extends DragController.
- Currently there is no pre-drag condition, so we immediately get onDragStart(), which starts the system global drag (which cancels the original internal drag).
- Make the original view invisible during the drag and drop operation, across both internal and system drag events.
- No longer handle onDragEvent() in TaskbarView, as TaskbarDragController handles all of it now.

Test: Drag and drop from taskbar still works (bonus: starts from the correct registration point that you touched down on). Locally added a PreDragCondition and verified a seamless handoff to system drag and drop when the pre drag end condition was met.
Bug: 182981908
Change-Id: I6bf48141a5eedfc6db6f461258e880ef8146e733
2021-05-25 15:35:58 -07:00
Sunny Goyal
c4c3269206 Crossfading splashscreen if icon is themed
Bug: 188840653
Test: Manual
Change-Id: Ibd00bb1a94576a7512872eba39a936c174f9871d
2021-05-25 18:25:18 +00:00
Sunny Goyal
6755587219 Using icon color for dot and halo
Bug: 188839628
Test: Manual
Change-Id: I8a393cc7073d5a249619b4033ec860c55f17167a
2021-05-21 12:57:38 -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
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
Sunny Goyal
8b9919de9f Removing some dependency on icon shape
Bug: 183641907
Test: Manual
Change-Id: Ifd492a850bb9918ad378385abe544362e34e70b0
2021-04-07 14:46:16 -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
Sunny Goyal
b65d766d88 Adding support for listening for app launch animation completion
Bug: 181165935
Bug: 179065491
Test: Verified on device
Change-Id: Ifa6a91560cb31b4dfb72a0f582607e873d8a002d
2021-03-10 15:53:21 -08:00
Jon Miranda
e126d72fa8 More grid changes, closer to final specs.
* Added isScalable, minCellWidth, minCellHeight, and borderSpacing attrs

When isScalable is true, we use set workspace cell values to
minCellWidth/minCellHeight and then scale the cell values to
fit the available space. This allows us to have consistent
aspect ratios when two devices match the display/grid options.

This is different from the dynamic grid, which calculates
cell values based on iconSize/textSize/etc and then allows
the cell width to be as wide as space allows.

I adjusted some variables so that they will auto adjust
based on another value, indepenent from whether the
grid isScalable or not. An example of this is the folder
label text, where it's always set to be 1.14x of whatever
the workspace icon text size is. This is so we don't need
to add a bunch of more variables to DisplayOption/GridOption.

Bug: 175329686
Test: - switching between device profiles,
      - testing folder open/close
      - testing in multiwindow
      - testing in landscape
Change-Id: Ia469ae0d65b518469ef264b726db46f4a3210056
2021-02-25 17:34:56 -05:00
Hyunyoung Song
db9a53d9aa Add group highlighting to AA+ result
Bug: 180071886
Test: manual
Change-Id: Id1cc3d7400e1a7fe41af272d689aa9315030b420
2021-02-18 02:19:27 -08:00
Tony Wickham
7ba547cd2d Folder support in Taskbar
- Add TaskbarActivityContext which allows shared Launcher elements to
  "just work" using existing generic ActivityContext.
- TaskbarContainerView extends BaseDragLayer<TaskbarActivityContext>.
- Inflate FolderIcon and Folder using TaskbarActivityContext to be
  shown in TaskbarContainerView.
- Use TaskbarActivityContext's DeviceProfile to determine icon size
  instead of overriding in styles. This also ensures that normal
  BubbleTextView icons have the same size as FolderIcons.

Test: Place a folder in home screen hotseat, ensure it shows up in
taskbar and can be opened, and that apps inside it can be launched
or dragged.
Bug: 171917176

Change-Id: Ic25d2f84bcd7e3399c88989305ea565497c030d9
2021-02-16 15:07:01 -08:00
Jonathan Miranda
8dd4ddc7ae Merge "Add border spacing and fixed cell height to grid." into sc-dev 2021-02-16 18:38:38 +00:00
Steven Ng
e92bc55d12 Make all widgets collapsed in the full widget picker by default
Changes:
1. Add a WidgetListHeader view for showing icon, app name and a subtitle.
2. Only WidgetListHeaders are always visible to users in the full widget
   picker.
3. Only one widgets list from an app is visible in the full widget picker
   at any one time.

Test: Auto: run add robolectric tests under widget/picker
      Manual: Open full widgets picker. Then, expand and collapse apps.
      Video: https://drive.google.com/file/d/1gzfeEm5IOAu0qHsO77OTS2eMfU7CHJiL/view?usp=sharing

Bug: 179797520
Change-Id: Idac58be23dfeafcb79b3c61b4972d3addb462de1
2021-02-15 17:46:38 +00:00
Jon Miranda
228877d37c Add border spacing and fixed cell height to grid.
- Border spacing is the spacing between the cells.
- Workspace cell height is now fixed, and we allocate
  all the "extra" space to three different variable height
  areas.

* Built behind ENABLE_FOUR_COLUMNS flag because it hinders the
default grid.

Bug: 175329686
Test: - set border spacing to 0 and confirm matches prior layout
      - test drag and drop still worked
      - test reordering
      - test widgets
      - test folders
      - test multiwindow

Change-Id: Ic6f3dff577d28ff214bda4b0a787ec7fd08c108b
2021-02-10 17:22:37 -05:00
Sunny Goyal
b0bff050f2 Merge "Moving slice loading on a background thread" into sc-dev 2021-02-04 23:29:42 +00:00
Sunny Goyal
79e52fc23b Moving slice loading on a background thread
> Also fixing slice icon loading, such that the request is cancelled
  if views are recycled quickly
> Loading widget label on dg thread and cancelling request if views
  are recycled quickly.

Bug: 179068415
Test: verified locally
Change-Id: Id5a524e2bf596862330a8170394aef9ffd708544
2021-02-04 13:03:33 -08:00
Tony Wickham
aaa42bd0e8 Add recent tasks to Taskbar
- Also adds a divider between Hotseat and Recents
- Dedupes Recents from Hotseat

Test: Open some recent tasks, ensure they are deduped
from Hotseat and also handle < 2 tasks.

Bug: 171917176
Change-Id: Ia782c6ccbcda94cfd844aad04dc3d25a3f072c2b
2021-02-03 18:54:58 -08:00
Hyunyoung Song
5809a40f3e Fix issue of slice icon being rendered on non-UIthread
Bug: 178989579
Test: Manual

Change-Id: I23aa5055c8f07ee9877c1f3ce51cb280ac38a2b7
2021-02-02 01:25:45 -08:00
Tony Wickham
794fe4f58e Add Hotseat items to Taskbar
- Currently supports WorkspaceItemInfo (e.g. normal app icons
  including hotseat predictions and pinned deep shortcuts).
- Currently doesn't support Folders, Notification dots, or
  long press.

Some technical details:
- Always allow HotseatPredictionController updates given the
  Hotseat is always showing even when Launcher is stopped.
- Represent Taskbar Hotseat items as BubbleTextViews, to
  allow for normal click handling etc. When the hotseat is
  updated, we reuse the same BubbleTextViews that were
  initially inflated, and just reapply the new info.
- Add new BubbleTextView iconDisplay for Taskbar, to allow
  for different treatment such as icon size.

Bug: 171917176
Change-Id: I325eb39051f2dc69228b39b5c40ed0cbdad8e200
2021-02-01 18:29:06 -08:00
Schneider Victor-tulias
5f7f4cb35d State download information in content description whether or not there was an update.
Talkback wasn't announcing the incremental download/install progress if the progress wasn't updated. Updated BubbleTextView to update the content description with the incremental download/install info if the progress bar should be shown.

Fixes: 149444435

Test: manual
Change-Id: I3efe6e31cec389da4119a2179a341aedd074a0b7
2021-02-01 19:01:11 +00:00
Schneider Victor-tulias
b40b98db3a Update FloatingIconView to display PreloadIconDrawables during swipe home animations.
Swiping up to go home on an app that is downloading incrementally would cause a jittery animation. Updated FloatingIconView to animate directly to a PreloadIconDrawable.

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

Fixes: 177685929

Test: manual
Change-Id: I4cd2daa18f6d3fed42a9b666063e0b1c1c46e5d9
(cherry picked from commit b8cab8d878)
2021-01-29 01:00:07 +00:00
Samuel Fufa
c282018765 Consolidate Search result UIs
- Allow SearchAction to be represented by SearchResultIcon and SearchResultIconRow
- Fix tap enter to launch regression
- Remove Plugin Pipeline

Bug: 177223401
Test: Manual
Change-Id: Id1d445f6af3f80f840d567165051188c78230ed0
2021-01-25 12:46:05 -06:00