am 05def021: am 71a3228b: Merge changes I0d44e948,I1db7a972 into eclair

Merge commit '05def0214087e3525f642e59debf4af57d445604' into eclair-mr2-plus-aosp

* commit '05def0214087e3525f642e59debf4af57d445604':
  Fix 2260199 - App icons placed in folder widget are doubled after rebooting phone.
  Fix bug 2261637 - Workspace previews home screens on long pressing
This commit is contained in:
Joe Onorato
2009-11-17 08:50:16 -08:00
committed by Android Git Automerger
3 changed files with 20 additions and 5 deletions
+15 -2
View File
@@ -55,6 +55,7 @@ import android.text.TextUtils;
import android.text.method.TextKeyListener;
import android.util.Log;
import android.view.Display;
import android.view.HapticFeedbackConstants;
import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.Menu;
@@ -563,7 +564,9 @@ public final class Launcher extends Activity
Drawable next = mNextView.getDrawable();
mWorkspace.setIndicators(previous, next);
mPreviousView.setHapticFeedbackEnabled(false);
mPreviousView.setOnLongClickListener(this);
mNextView.setHapticFeedbackEnabled(false);
mNextView.setOnLongClickListener(this);
workspace.setOnLongClickListener(this);
@@ -1469,10 +1472,18 @@ public final class Launcher extends Activity
public boolean onLongClick(View v) {
switch (v.getId()) {
case R.id.previous_screen:
showPreviousPreview(v);
if (!isAllAppsVisible()) {
mWorkspace.performHapticFeedback(HapticFeedbackConstants.LONG_PRESS,
HapticFeedbackConstants.FLAG_IGNORE_VIEW_SETTING);
showPreviousPreview(v);
}
return true;
case R.id.next_screen:
showNextPreview(v);
if (!isAllAppsVisible()) {
mWorkspace.performHapticFeedback(HapticFeedbackConstants.LONG_PRESS,
HapticFeedbackConstants.FLAG_IGNORE_VIEW_SETTING);
showNextPreview(v);
}
return true;
}
@@ -1501,6 +1512,8 @@ public final class Launcher extends Activity
} else {
if (!(cellInfo.cell instanceof Folder)) {
// User long pressed on an item
mWorkspace.performHapticFeedback(HapticFeedbackConstants.LONG_PRESS,
HapticFeedbackConstants.FLAG_IGNORE_VIEW_SETTING);
mWorkspace.startDrag(cellInfo);
}
}
@@ -616,6 +616,7 @@ public class LauncherModel extends BroadcastReceiver {
mItems.clear();
mAppWidgets.clear();
mFolders.clear();
final Cursor c = contentResolver.query(
LauncherSettings.Favorites.CONTENT_URI, null, null, null, null);
+4 -3
View File
@@ -139,6 +139,7 @@ public class Workspace extends ViewGroup implements DropTarget, DragSource, Drag
mDefaultScreen = a.getInt(R.styleable.Workspace_defaultScreen, 1);
a.recycle();
setHapticFeedbackEnabled(false);
initWorkspace();
}
@@ -352,6 +353,7 @@ public class Workspace extends ViewGroup implements DropTarget, DragSource, Drag
}
group.addView(child, insert ? 0 : -1, lp);
if (!(child instanceof Folder)) {
child.setHapticFeedbackEnabled(false);
child.setOnLongClickListener(mLongClickListener);
}
if (child instanceof DropTarget) {
@@ -426,10 +428,8 @@ public class Workspace extends ViewGroup implements DropTarget, DragSource, Drag
if (vacant) {
group.addView(child,
new CellLayout.LayoutParams(mTempCell[0], mTempCell[1], spanX, spanY));
child.setHapticFeedbackEnabled(false);
child.setOnLongClickListener(mLongClickListener);
if (!(child instanceof Folder)) {
child.setOnLongClickListener(mLongClickListener);
}
if (child instanceof DropTarget) {
mDragController.addDropTarget((DropTarget)child);
}
@@ -1094,6 +1094,7 @@ public class Workspace extends ViewGroup implements DropTarget, DragSource, Drag
}
cellLayout.addView(view, insertAtFirst ? 0 : -1);
view.setHapticFeedbackEnabled(false);
view.setOnLongClickListener(mLongClickListener);
if (view instanceof DropTarget) {
mDragController.addDropTarget((DropTarget) view);