OSDN Git Service

New launcher2 icon migration algorithm.
authorDan Sandler <dsandler@android.com>
Thu, 9 Jan 2014 20:01:33 +0000 (15:01 -0500)
committerDan Sandler <dsandler@android.com>
Fri, 10 Jan 2014 20:49:51 +0000 (15:49 -0500)
commitd502404a44fb7c4ea739622d7f8bdd2a764d97a1
tree2d14d3da3c805d6dcb61b9573ffdbc8cb4e85dc9
parent0bae5b220a24541dbc69fb2cb755f303776d0a59
New launcher2 icon migration algorithm.

The user will be able to request "icon migration", which is
not a direct mapping of the old workspace, but rather
follows this heuristic for bringing the user's favorite
icons (by dint of their existence on the workspace) into
Launcher3:

Workspace shortcuts are placed in lexicographic order on the workspace
starting at screen 0 (leaving the bottom row of screen 0 empty to make
sure there's room to move things around). Folders are preserved and
their contents sorted. Duplicate icons (that is, shortcuts
with the same intent, pursuant to some cleanups) are removed.

Hotseat icons are migrated in their original place, unless their new
location is not accommodated by the hotseat (i.e. the L3 hotseat is
too small on this device), in which case they're treated like any
other shortcut and tossed into the workspace.

To test, turn on Launcher.ENABLE_DEBUG_INTENTS and then:

$ adb shell am broadcast -a com.android.launcher3.action.DELETE_DATABASE
$ adb shell am broadcast -a com.android.launcher3.action.MIGRATE_DATABASE

Bug: 12416411
Change-Id: Ia5c56f36c11455867ea20a39f70210f595020a87
AndroidManifest.xml
src/com/android/launcher3/Launcher.java
src/com/android/launcher3/LauncherModel.java
src/com/android/launcher3/LauncherProvider.java