OSDN Git Service

Don't lose icons when migrating from different-sized hotseats.
authorDan Sandler <dsandler@android.com>
Fri, 7 Mar 2014 04:48:04 +0000 (23:48 -0500)
committerDan Sandler <dsandler@android.com>
Fri, 7 Mar 2014 04:54:24 +0000 (23:54 -0500)
commitab5fa3a06ad7203a7bdab899f1951d9e9dc92d5f
tree2987881e1b06baa3cd49ddc2fadf6b67a0e11ef8
parent0c255a946788499d7f169429890d5a423426593b
Don't lose icons when migrating from different-sized hotseats.

Launcher2 on sw720dp devices had 8 hotseat slots; Launcher3
has only 6 on those same devices. When importing the old
hotseat, the empty slot (so technically there were 9)
occupied by the all apps button didn't line up with the new
all apps button, causing a hole on the hotseat. Furthermore,
the icon in old position 3 was clobbered by the new all apps
icon:

    0 1 2 3 (#) 4 5 6 7 ==> 0 1 2 (:) _ 4 5

In this CL we introduce a separate sort-and-place step for
hotseat icons so that any icon colliding with the new
all-apps slot can be moved to the right to find the next
nearest open slot. This works well for the 8->6 case; it
will probably do something reasonable, if not ideal, for
other grid migration scenarios.

But those are not covered by this bug.

Bug: 13015468
Change-Id: I7edb3f27addc78ad02bbfcd1c39175ca56220007
src/com/android/launcher3/LauncherProvider.java
src/com/android/launcher3/LauncherSettings.java