Commit Graph

45 Commits

Author SHA1 Message Date
Stefan Andonian
e82476ad3b Rename LoaderResults to LauncherBinder.
LoaderResults implies a data object, not binding code specific to
Launcher UX containers. This CL merely renames this class and its
usages. It also adds a comment that explains why the functionality is
split into a base class and an implementing class.

Bug: 251502424
Test: Compilation worked correctly.
Change-Id: I01b5ac2f717e9b20612538d5c1e0ca947beb593f
2023-01-11 20:32:25 +00:00
Raj Garg
4b90dbe967 Revert "Introducing new variable to enable/disable shortcuts."
Revert "Introducing new variable to enable/disable shortcuts."

Revert submission 19632697-cherrypick-GO-DISABLE-SHORTCUTS-tyyzrpy9oe

Reason for revert: Reverting changes for the recent feature built by me. This CL was a part of the feature. Please take a call if we should revert it or not.
Reverted Changes:
Ib373b042f:Introducing new variable to enable/disable shortcu...
I4274cb468:Introducing new variable to enable/disable shortcu...

Change-Id: I81f338be71185cb008e81b020c5b3a7b01b64c58
2022-09-23 17:04:29 +00:00
Raj Garg
63ee5d0908 Introducing new variable to enable/disable shortcuts.
Widgets and shortcuts are two different entities but they are controlled
by same variable GO_DISABLE_WIDGETS. In this CL I have introduced a new
variable GO_DISABLE_SHORTCUTS to enable/disable widgets.

Test: Tested manually on device.
Bug: 236268654
Change-Id: Ib373b042fbfd0493e6345ef10e5631dbfd96b8c3
2022-08-16 09:18:23 +00:00
Shikha Malhotra
e957b600d3 Refactor code to be used in LauncherLily features
Refactor add to workspace code to be used in Lily Launcher.
Also utilising code swap feature to swap out functionality of sorting
items on workspaces and finding next vacant space.

Bug: b/218186705
Test: Manually tested Launcher3 works.
Change-Id: I42a44eabeb307e1d23ef333e0a169437f9062bb6
2022-04-20 07:22:20 +00:00
Steven Ng
43859f10bc Group weather widgets under the widget category
Test: manual (see video in bug) and added PackageUserKeyTest
      Also tested pending conversation widget to ensure the right icon
      is shown.
Fix: 201062480
Change-Id: If23c28bd93c54fb1747648309ab3c238a1810902
2021-09-30 14:22:21 +01:00
Sunny Goyal
ed2a55f413 Removing widget preview caching
> All previews are generated on demand when the corresponding
  header expands
> Using ItemAnimator to animate layout changes when preview loads

Bug: 196238313
Test: Manual
Change-Id: I0cb859c8443c2c536399e4063f58baecfc7416ad
2021-08-17 17:50:30 -07:00
Steven Ng
12f7a59e5c Use category icon for pending conversation widgets
Fix: 192333050
Test: Manual
Change-Id: Ie3895cd4747f1bec1c8ca9af82347bb0eafa7415
2021-06-29 18:04:09 +01:00
Stevie Kideckel
69af278f8a Refresh widgets in the model when packages change
Fix: 191163748
Test: local sample app
Change-Id: Ic09ad11cabf6efa471fb6e685cb255c4a17493ee
2021-06-17 13:08:53 +00:00
Steven Ng
1d47d8c705 Use grid size as the upper bound for widgets' default size in initSpans
Test: In Pixel 4, drag a monthly view Google calendar widget to a new
      home page from the full widgets picker. The widget outline is
      correctly shown.
Bug: 189060113
Change-Id: I33113b29cc8923098de95f1d5eb14c2b02429de1
2021-06-08 14:15:50 +01:00
Steven Ng
833a0b9fa9 Add a widget conversations category for grouping widgets in the picker
Bug: 184878454
Test: Open the full widget picker and observe the conversation widget
      from SystemUi is listed under conversations.
Change-Id: I53cd74d80ce3c4ff77a92cd660ca9283416e9fd3
2021-04-08 22:35:55 +01:00
Steven Ng
1a4670eeff Only clear widgets list upon all widgets & shortcuts update
Test: Install BBC News. Then, quickly go to all widgets tray.
      BBC News widgets is added to the all widgets tray without
      removing other widgets.

Bug: 182897740
Change-Id: I17b50f5128e24c346354b8fb7817a318a94efb62
2021-03-16 19:30:04 +00:00
Steven Ng
3a8353256a Widgets recommendation backend
Add a widgets recommendation mechanism based on AiAI app predication
ranking with the following changes:

1. Only one widget is picked from one app.
2. Widgets that are already added to the workspace are excluded from
   the recommendation.

Test: run PredicationUpdateTaskTest

Bug: 179797520
Change-Id: Ia697bc6df0bae75969e68b7b3de32d57901f7461
2021-03-08 23:37:51 +00:00
Yogisha Dixit
741fae9ea2 Move widget files into widget folder + add tests.
I will use the newly created LauncherAppWidgetProviderInfoTest in a follow-up CL to add tests for the newly added widget sizing APIs.

Test: Automatic: Ran all robolectric tests in launcher3,
      Manual: Added a widget, edited the widget, removed the widget
Bug: 179807199
Change-Id: I540b2dbe284c6eb5aa2466a1d13a9581ee59425b
2021-03-01 13:59:52 +00:00
Steven Ng
391404fcb7 Add personal / work tabs for work profile widgets
Video: https://drive.google.com/file/d/1TORRNcvVM7fIvNd_WZaajLbI7D9z4VFA/view?usp=sharing


Test: Main profile only: run AddConfigWidgetTest.
      With work profile: manually launch the full widgets sheet.
      Go to the personal tab: only personal widgets are shown.
      Go to the work tab: only work widgets are shown
      Successfully add personal / work widgets from the full widgets
      sheet.

Bug: 179797520

Change-Id: Iad8b90c2af35e0580319d7a05510ec88e4f8b86c
2021-02-22 16:10:09 +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
Steven Ng
2f5648a911 Refactoring before adding a new view type in the WidgetsListAdapter
Changes made:
1. Model: added an abstract class for storing common information for
   entries shown in the full page widgets picker.
2. Introduced a ViewHolderBinder interface to split the logic of binding
   data to ViewHolder into separate classes.
3. Move the view holder binding of WidgetsListRow from WidgetListAdapter
   to its new class.
4. Move some widgets picker classes into a new picker package.

Test: Auto: Run WidgetsListAdapterTest, WidgetsListRowEntryTest and
      WidgetsListRowViewHolderBinderTest.
      Manual: open the all apps widgets tray and navigate the list.

Bug: 179797520
Change-Id: Iab29557842bb79156cad84d00a4c5d0db0c5aa06
2021-02-10 21:23:40 +00:00
Sunny Goyal
4484015f48 Simplifying AppFilter
Change-Id: I36217a42aa67f2b3bc3a3226ace2ef7e194956a6
2020-09-08 16:31:17 -07:00
Sunny Goyal
d4d2a73b67 Removing MultiHashMap and using java-streams instead
This makes it easier to choose different collection
implementations

Change-Id: Ic44e128b7478fcbbb1b546027685e058945af3f9
2020-08-27 15:26:18 -07:00
Sunny Goyal
63d327442c Disabling notification dots for Launcher3Go
Bug: 164457095
Change-Id: If751719a698785957d37b4656a0132d2b56b64f9
2020-08-19 17:04:38 -07:00
Sunny Goyal
5fb83a47f2 Removing icon recents version
Change-Id: Ibdc88715e38590cedf8a7b5174061bb2c6ef9533
2020-08-14 10:49:19 -07:00
Sunny Goyal
e396abf502 Moving model data structures to a separate file
Change-Id: I77ad7a5219e72d2e0d6c1803de2ac3ed6a65a8f7
2020-04-09 13:20:39 -07:00
Tracy Zhou
bd22546683 Render user's actual workspace in ThemePicker preview (Part 6)
Didn't test out widgets in Part 5. So in this change,
- Added some widget classes to the PreviewContext WHITELIST
- Manually update widget model after loading workspace since we do not attach widget listeners to the LauncherAppModel for preview.

Change-Id: I0a555b2319b2e91432dbd58289ddb66aca1384df
2020-03-02 00:44:55 -08:00
Tracy Zhou
7be160170d Merge "Render user's actual workspace in ThemePicker preview (Part 5)" into ub-launcher3-master 2020-02-20 05:53:45 +00:00
Tracy Zhou
10a285dc24 Render user's actual workspace in ThemePicker preview (Part 5)
This change takes care of rendering widgets using widget provider's layout info.

Test: manual
Bug: 144052839

Change-Id: I7002d8bf653513cdd317736d550a47f61f0ee474
2020-02-19 16:46:25 -08:00
Zak Cohen
3eeb41de9a Rename flag IS_DOGFOOD to IS_STUDIO.
The flag is only set when building from Android Studio... and is never
used for dogfood.

Test: local
Change-Id: I898d585f4558c2437f0152ef102bea59c351f80b
2020-02-14 14:19:59 -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
Sunny Goyal
a7a5bf3101 Adding support for multiple Model clients
Bug: 137568159
Change-Id: Ia4db800b19cc80c695fcb9ea28e07709dfd08c6a
2020-01-10 12:23:27 -08:00
Sunny Goyal
fa39536570 Removing static reference of deep shortcut manager
Bug: 141376165
Change-Id: Ie60b82be63a8926825598c681d8b2a1b2ace6413
2020-01-02 20:13:12 +00:00
Sunny Goyal
337c81f664 Removing static instances of UserManagerCompat and AppWidgetManager
> Changing the lifecycle to follow other static objects in Launcher
> Removing compat interface and inlining everything to helpers

Bug: 141376165
Change-Id: I82bd5db1969101de9a7eac77f32728d70195bb35
2019-12-11 10:03:19 -08:00
Sunny Goyal
e7b00128c7 Removing static instance of LauncherAppsCompat and unnecessary wrapper classes
Bug: 141376165
Change-Id: I8c1f1ab7d83ec50fe9c7bf39960ef9c360025ec7
2019-10-02 16:20:22 -07:00
Sunny Goyal
3e3d759db2 Removing flag overrides. All flags should be defined as togglable flags instead.
Change-Id: Ia7b9ff84413096cd5b0c4a9a81a232019f2522d2
2019-09-12 10:17:14 -07:00
Pinyao Ting
2f9019e56c add null check when accessing target component from iteminfo
Bug: 139540363
Change-Id: I25d0100077de67b085c27b5ef91e22c6ac1ad959
2019-08-16 14:25:31 -07:00
Pinyao Ting
49a3e699f9 show dot in deep shortcuts when notification contains exactly identical
set of person

Bug: 132336512
Change-Id: I975524e28168c10a186cdc24b188c161faf433cf
2019-08-05 20:41:58 -07:00
Pinyao Ting
0cd5bd5f95 Ensure each dot contains only relevant notification to the shortcut
and displays system shortcut when long click on deep shortcut.

In this CR we
1) for each shortcut, we filters the notifications to ensure we only
 get notifications with identical shortcutId.
2) allow system shortcut to be displayed when user long click on a
DeepShortcut

Bug: 132336512
Change-Id: Idc9eaed55e900ed4027a43ee9c3fd7dc6f4480b2
2019-08-01 02:47:24 +00:00
Pinyao Ting
559dd806d7 show dot on shortcut when incoming notification contains exactly the
same shortcut id

Bug: 132336512
Change-Id: Iddf4cfe8ad60c12e8de8b171bed392f1bb0a6761
2019-07-29 16:53:52 -07:00
Sunny Goyal
87dcde6d6c Separating apps list callback from model callback and simplifying various events
Bug: 137568159
Change-Id: I4d8bb5c01cabe642731ebd3f57fe15bdc5a569b7
2019-07-25 11:29:16 -07:00
Sunny Goyal
31ab19f71d Removing global state from DeepShortcutManager
This makes DeepShortcutManager thread-safe and avoids any locks

Change-Id: If4593b3541da6259591ff7a607efa58158006481
2019-07-17 15:16:33 -07:00
Sunny Goyal
6bbf6004f8 Removing ShortcutInfoCompat and directly using ShortcutInfo
Change-Id: I2842689e192a206c0d31558c8126eae1c7904598
2019-04-22 15:39:40 -07:00
Sunny Goyal
9589916418 ShortcutInfo renamed to WorkspaceItemInfo
Will get rid of ShortcutInfoCompat in a follow up cl

Change-Id: I7d7d9c938635f59b216290ba28bea9d0e0721a7d
2019-04-16 00:08:24 -07:00
Sunny Goyal
8c48d8bea6 Changing min sdk to 25
Change-Id: I0d28069967854357ca755bf25dec19d4979bdecf
2019-01-29 11:29:52 -08:00
Hyunyoung Song
cbd01fc3dc Handle null ItemInfo.title for widget list
Bug: 122809947
Change-Id: I2f72fb0e152e93adbb4bc4204d5d688b273452ad
2019-01-15 11:45:33 -08:00
Sunny Goyal
9dbdd72498 Migrating some runnables to lambda operations
Change-Id: Ied7b6ca14594c72bc671127baf4f84fdcdb35b93
2018-12-27 13:29:34 -08:00
Rajeev Kumar
1baf8a78c6 Create a launcher LoaderResults override.
This change disables shortcuts/widgets binding on Android Go devices.
Bug: 112904271
Test: Manual test

Change-Id: I3dbcd23dc448ff9ca5fe6c32958dcffb51c4bcf5
2018-11-05 15:43:53 -08:00
Rajeev Kumar
0a926c1d67 Create a launcher model override.
This change disables shortcuts/widgets loading on Android Go devices.
Bug: 112904271
Test: Manual test

Change-Id: I2c40f87a8f5d752525c99d254693a4e0a9eeeb2b
2018-11-02 15:25:25 -07:00
Rajeev Kumar
51ca603ac4 Create a deep shortcuts override.
This change disables deep shortcuts on Android Go devices.
Bug: 112904271
Test: Manual test

Change-Id: I6150a3500f67d8a8412b51796cc442e3384c2cbb
2018-10-31 13:52:38 -07:00