Commit Graph

40 Commits

Author SHA1 Message Date
Pinyao Ting
d88f63bbed add null check when accessing target component from iteminfo
Bug: 139540363
Change-Id: I25d0100077de67b085c27b5ef91e22c6ac1ad959
Merged-In: I25d0100077de67b085c27b5ef91e22c6ac1ad959
2019-08-16 21:50:21 +00:00
Sunny Goyal
371ea051d1 Fixing launcher UI not reapplied properly when IDP changed as a result of display changes
> Removing unnecessary check when binding model data as its safe to bind old data,
  we should just not persist it (that check is already there in model writer)
> Adding additional check in model bind to skip old bind if there are multiple binds

Bug: 126259547
Bug: 118441555
Change-Id: Ic250d2af13797d3e70c6e1fc70da65ebe6ab8d70
2019-03-06 15:41:29 -08:00
Sunny Goyal
ef92b82778 Adding support for launcher preview generation
Creating a utility class which generates a launcher preview
for a provided InvariantDeviceProfile

Bug: 118758696
Change-Id: I0aebeb6eed37f72edd1cc305e58eece305aae3ff
2018-12-04 20:19:14 -08:00
Sunny Goyal
efb7e84242 Converting long item IDs to int
> Items ids were already being typecasted to int when being bound on the UI
> Using a consistent type allow better use of platform data-structures
> Adding IntArray and IntSet as a replacement for various Collection classes

Change-Id: Id3c650ed2420c2bfca3bd7671d2b705b56112371
2018-10-08 14:52:39 -07:00
Mario Bertschler
8ff9e1d679 Integrating suggested app by handling new status flags for shortcut items.
Guarded via feature flag SUGGESTED_APP.

Bug: 62483883

Change-Id: I7e0c8a9875bc37c435aa4316b44322a628cd4826
2017-08-24 12:23:06 -07:00
Sunny Goyal
34ab6df435 Fixing legacy shortcuts which only specify packageName in the intent
dont get restored on apk install.

For various model update task, we only use targetComponent (unlike loader
where we all check packageName for legacy shortcuts).
This causes various shortcuts which only specity packageName in the intent
to get skipped during the check. Instead creating a pseudo component for
these shortcuts similar to IconCache

Bug: 62944669
Change-Id: I0aa0a4c15ef3ad88dc6cdd579a76315fb2ff780b
2017-07-06 08:20:18 -07:00
Hyunyoung Song
86160f5d5b code cleanup: regarding Favorites debug logging
Change-Id: Ie4d4ffda30ce3b495c2b9fd57ea584d45cc3357d
2017-03-28 14:05:54 -07:00
Sunny Goyal
24bb66a1c5 Removing the profile extra from intent and using the profile id from the profile column
The intent extra is not always correct as the profile id can change during backup restore.
This allows us to use a consistant behavior everywhere.

Change-Id: I004bd244204ca91758b1d42488e1fc13b0ccb998
2017-03-21 15:14:43 -07:00
Sunny Goyal
658058b960 Adding some widget addition flow tests
> Added two dummy widget providers: with config and without config
> Added tests for verify widget config flow

Change-Id: I4577f085abe8f8b82047b644c71cc9065358153a
2017-01-23 15:28:25 -08:00
Sunny Goyal
7c74e4ae64 No more UserHandleCompat
Bug: 32745285
Change-Id: I762fb4e268c1afe48a1860ab12a4ccb3f626aa95
2016-12-15 22:06:10 -08:00
Sunny Goyal
32f3dda802 Adding a utility class to enforce that icons are always flattened on
the background thread.

Bug: 21325319
Change-Id: I4d0f02557cdbf70cfa86750ac047faf2917e39bf
2016-11-19 23:40:07 +05:30
Hyunyoung Song
0de011705b Code sanitization
- Removed bad method/class name typos

Change-Id: Ie6900e9e3d9ce9b550d2a2442a5dac3f7050a573
2016-10-06 10:57:29 -07:00
Sunny Goyal
1edab71d01 Unifying toString() method for various ItemInfo subclasses
Change-Id: I7cde42f0df412e2877fb93c77e74ee56a25edead
2016-09-01 10:55:45 -07:00
Tony Wickham
1bce7fd342 Long-press on an app to reveal its shortcuts.
- Add ShortcutsContainerListener to icons on workspace, folders, and
  all apps. This handles long-press and forwards following touches to
  the DeepShortcutsContainer that is created.
- Drag over shortcut before lifting finger to launch it.
- Shortcuts are rendered in pill-shaped DeepShortcutViews,
  which are inside DeepShortcutContainer on DragLayer.
- The shortcut container orients above or below the icon, and left or
  right-aligns with it. Biases for above + left-align.
- Long press a DeepShortcutPill to drag and pin it to the workspace.

Bug: 28980830
Change-Id: I08658d13ae51fe53064644e8d8f7b42f150fdd7d
2016-06-29 17:48:46 -07:00
Tony Wickham
bfbf7f9f4a Add support for launcher shortcuts.
- This CL has no UI but provides the necessary backing for one.
- Adds new item type: ITEM_TYPE_DEEP_SHORTCUT, to distinguish from
  ITEM_TYPE_SHORTCUT. We can reconsider these names.
- Adds ShortcutCache, using LruCache for up to 30 dynamic shortcuts
  (pinned shortcuts are always cached in a HashMap).
- DeepShortcutManager queries for shortcuts and other things like
  pin them. In a future CL it will use the cache, but for now it
  simply makes an RPC for all queries.
- LauncherModel maintains counts for pinned shortcuts, pinning and
  unpinning when counts reach 1 or 0, respectively.
- LauncherModel maintains a map of components to lists of shortcut ids,
  which Launcher gets a copy of after it is changed in the background.
  This will allow us to know how many shortcuts an app has immediately,
  and query for details as the UI is animating.

Change-Id: Ic526f374dd10d72a261bae67f07f098fca8d8bca
2016-06-21 15:49:16 -07:00
Sunny Goyal
aaf7d1d13b instead of unbinding items from the loader, unregistering listeners
in activity.onDestroy()

Bug: 28740269
Change-Id: I6bf2ad6aca43970fd10cfbcc113e609c227e07bf
2016-05-17 14:42:10 -07:00
Kenny Guy
44cba69638 Grey out suspended applications.
Grey out application shortcuts and all apps entries
for packages that are suspended.

Bug: 22776761
Change-Id: I1b63da1816aca1de52b9f9bee62d1b162d0cdf4d
2016-01-25 11:28:06 +00:00
Sunny Goyal
de51d1d1af Regression in ag/753709
Item values were not read properly in savedInstanceState

Change-Id: If45b7085555076b03ebd4a97a3ff939487ca8ce1
2015-08-31 11:48:24 -07:00
Sunny Goyal
756cd26592 General code refactoring
> Removing utility method for isAttachedToWindow
  > Moving logic to calculate cell size from workspace to DeviceProfile
  > Replacing some constants with xml resource variables
  > Saving the item info using content values for better compatibility with other methods

Change-Id: Idd612633d97a6241cb31148df9466031374bd5a0
2015-08-20 12:56:58 -07:00
Vadim Tryshev
d6c8e7eeb1 Code to enable dragging to System UI shelf.
This CL doesn’t let the new code run, it’s under a compile-time flag,
and the behavior should be same as before.

The change introduces a concept of a DragDriver, which encapsulates
behavior of the existing DND (InternalDragDriver) or the framework-
driven DND (SystemDragDriver).

An instance of DragDriver gets created by DragController for the time
while a DND operation is in progress, and it takes care of translating
DND events for DragController.

Also did some cleanups, like removing meaningless fields etc.

Plans for future: keep working in Burnaby, and:
* Perhaps, better separate DragDriver from DragController
* Detect fling gesture for system DND
* Look at accessibility
* Polish animations and appearance
* Fix dragging from folders
* Support cancelling DND

Then, it will become possible to enable new dragging (based on Android
version).

Bug: 22028725
Change-Id: I41b40e9d512d83937f5b101ac8e3e8e7e807c269
2015-07-30 13:06:25 -07:00
Sunny Goyal
aa8ef119f1 Refactoring ItemInfo
> Changing dragObject to ItemInfo
> Removing dropPos which is always null
> Removing requiresDbUpdate which is only used in CellLayout

Change-Id: I753ddaae0880c8a9bfee5a1266095ff34610284a
2015-06-30 10:26:49 -07:00
Hyunyoung Song
3f471440a8 WidgetTray revamp work
- RecyclerView is rendering
- Animation is connected
- Drag and drop is now handled
- UI tweaking: background, margins, more to come.
- Flicker and preview not loading issue:
  fixed height for the horizontal scroll view.
- Shortcuts are added
- Widget Preview loading should support shortPress for drop
- UI tweaks left: overlay of arrow when there are more items to scroll
- icons are added in the section header
- Sorting of widget sections and widget horizontal list
- Adding all the padding constants to dimen.xml file
- RecyclerView should only support one view type

For items to be addressed in follow up patches OR CLs,
TODO is added to the comment.

b/19897708

Change-Id: Ibfc4da1696a23d20bada93db46e126706eb13cdc
2015-04-08 19:01:34 -07:00
Sunny Goyal
5b0e669169 Rewrite: Widget preview loader logic
> Widget previews are saved in data dir instead of cache dir
> Expiring widget previews similar to IconCache
> Removed support for setting thread priorities

Bug: 19865031
Change-Id: Ib6033c2b1ff8ae61bba8762ca994ccd8217d3c75
2015-03-20 17:31:11 -07:00
Sunny Goyal
08f7261d11 Adding a rank column for itemInfo
> Rank is used to determine position of an item
in a folder.

Bug: 18590192
Change-Id: I2826a7c570b4cc58e719d685f17a24ec6133804f
2015-01-13 22:19:56 +00:00
Sunny Goyal
349426234e Handling label and icon from SessionInfo.
> The ShortcutInfo stores state as bit flags and not as ints
> Intents of auto-install shortcut are automatically updated
upon installation
> Icons/titles for active sessions are cached in IconCache

Change-Id: I2047849f67d4a8aaf2bc346b58110325bb4807d4
2014-09-04 08:18:33 -07:00
Sunny Goyal
ff57227711 Adding support to restore widgets even for jelly beans.
> Show 'widget-not-ready' until the widget app is installed
> Once the app is installed, bind a new widget id (not required on L if
  id-remap was received).
  **Remove the widget if bind failed
> If the widget has no configuration screen, show the widget, otherwise
  show 'setup-widget'.
> Clicking 'setup-widget' shows the config screen, and updates the
  widget on RESULT_OK.

issue: 10779035

Change-Id: I2f8b06d09dd6acbc498cdd93edc59c26e5ce17af
2014-08-08 14:29:02 -07:00
Kenny Guy
d6fe52636d Change getBadgedLabelForUser to use CharSequence
Bug: 16401636
Change-Id: I7b72a6dd53fec1c0afe6ea33803af9e3c54e597e
2014-07-21 18:33:40 +01:00
Kenny Guy
c2bd8101b8 Revert "Revert Cls stopping now-master running on googlefood"
This reverts commit 7bc272a11b.

Conflicts:
	src/com/android/launcher3/BubbleTextView.java

Change-Id: Id1fb2e1249e72658ce5477165c9bcacba9de2b04
2014-06-30 12:30:31 +01:00
Kenny Guy
7bc272a11b Revert Cls stopping now-master running on googlefood
This reverts commits 01453e855f.
and 242bbe1b72.
"Add content description to bagded icons."
"Remove reflection now we are building against L"

Bug: 15833449
Change-Id: I81a5316f5619a9cd3b6ab9fd03b2ba96657b7f68
2014-06-24 11:43:19 +01:00
Kenny Guy
01453e855f Add content description to bagded icons.
Enabled accesibility so that icons badged by the
managed profile have a content description
that is different to the non-bagdged version.

Bug: 15106236
Change-Id: Id483273173d9539916eebd59111d179087526be3
2014-06-23 16:42:37 +01:00
Kenny Guy
ed13187a74 Launcher3 multi-profile support
Use LauncherApps API and badging APIs instead of PackageManager.
With compatability layer that uses PackageManager pre L.

Adds support to show apps from current user and any managed profiles.

Background: Managed profiles are user sandboxes that are visible from
the primary user and can be launched as if they are a part of this user.
A launcher should now be capable of listing apps from this user as well
as related profiles of this user.

Launching of activities is now via the LauncherApps interface, to allow
for cross-profile app launching. Only activities with category LAUNCHER
can be added as a shortcut on the workspace for a managed profile.

Widgets and non-application shortcuts are only supported for the
current profile. Widgets from the managed profile are not available.

Change-Id: I5f396b1bf7f91ad91a5710ea4a0fd14573972eb9
2014-04-30 23:43:00 +01:00
Adrian Roos
8f3f6830f2 Sanity check screenId before persisting ItemInfo.
Bug: 13447571
Change-Id: I014dcf1eb313c2312953716fb53e542caaeb285b
2014-04-28 15:45:55 +02:00
Sameer Padala
be3e410b7a Fix source code so it compiles on google3
This is a follow up to cr/65191596 which checked for String + array warnings.

Change-Id: Id70eaa32b63b838b03be21d632c7470039b6423f
2014-04-21 19:37:17 -07:00
Anjali Koppal
e3e646e1f0 Make all fields of ItemInfo public.
Change-Id: Iaf99aa125634a467616eedd0888a0affa08d79bd
2014-03-17 15:08:41 -07:00
Chris Wren
b6d4c2827a update placeholder on package install or restore
Bug: 10778992
Change-Id: I3293d8bab8ae0ef49fc5554531bba5bd6f70932c
2014-02-06 15:05:16 -05:00
Mathew Inwood
72fbec17e0 Add support for initiating a drag from an overlay.
This allows an overlay to create apps and shortcuts on the home screen.

Change-Id: I63ee4ef02db3f4bc89726c394fd55ad26f50452c
2013-11-20 11:45:53 +00:00
Winson Chung
997a92348a Removing old new-app animation code, and refactoring InstallShortcutReceiver to use new add/bind logic.
Change-Id: Ide27dbcf1d1b1631fcd33a6c54a51b31e125c2f4
2013-07-26 12:58:45 -07:00
Michael Jurka
1e2f465f46 Implement ability to uninstall shortcuts from workspace
Change-Id: I14ca94ea719825c4de19ab85d67537155098d50c
2013-07-19 17:15:39 -04:00
Adam Cohen
dcd297f05a Initial implementation of Shrink-wrap
Change-Id: If73c7f7ca19ca62ff43134f515584354afef8507
2013-06-25 12:29:32 -07:00
Daniel Sandler
325dc23624 Launcher2 is now Launcher3.
Changes include
  - moving from com.android.launcher{,2} to
    com.android.launcher3
  - removing wallpapers
  - new temporary icon

Change-Id: I1eabd06059e94a8f3bdf6b620777bd1d2b7c212b
2013-06-05 23:30:20 -04:00