Adding support for drag and drop of folders and shortcuts.

also:
- Long press on empty space on workspace now brings up customization tray
- Fixed: while dragging, items appeared to be dropping on folders two cells to the right
- Fixed: Disabling drops on folders when the workspace is shrunken
- Fixed: account for scaling of dragged items when checking if they overlap
          with shrunken workspace screens
- Making folder icons dimmable to match shortcuts and widgets
- When deciding with shrunken workspace screen we're dragging to, we now use the closest screen rather than the one that has been overlapped the most
- Refactored drag/add mechanism, removing array of occupied cells from CellInfo
- Removed dead code/variables
This commit is contained in:
Michael Jurka
2010-09-17 15:00:07 -07:00
parent 513b8c94fb
commit 0280c3be4d
17 changed files with 659 additions and 605 deletions

View File

@@ -50,11 +50,6 @@ public class InstallShortcutReceiver extends BroadcastReceiver {
String name = data.getStringExtra(Intent.EXTRA_SHORTCUT_NAME);
if (findEmptyCell(context, mCoordinates, screen)) {
CellLayout.CellInfo cell = new CellLayout.CellInfo();
cell.cellX = mCoordinates[0];
cell.cellY = mCoordinates[1];
cell.screen = screen;
Intent intent = data.getParcelableExtra(Intent.EXTRA_SHORTCUT_INTENT);
if (intent.getAction() == null) {
@@ -66,7 +61,7 @@ public class InstallShortcutReceiver extends BroadcastReceiver {
boolean duplicate = data.getBooleanExtra(Launcher.EXTRA_SHORTCUT_DUPLICATE, true);
if (duplicate || !LauncherModel.shortcutExists(context, name, intent)) {
((LauncherApplication)context.getApplicationContext()).getModel()
.addShortcut(context, data, cell, true);
.addShortcut(context, data, screen, mCoordinates[0], mCoordinates[1], true);
Toast.makeText(context, context.getString(R.string.shortcut_installed, name),
Toast.LENGTH_SHORT).show();
} else {