Merge "Fixing small folder bugs"

This commit is contained in:
Adam Cohen
2011-05-05 10:44:55 -07:00
committed by Android (Google) Code Review
+10 -1
View File
@@ -29,6 +29,7 @@ import android.content.Context;
import android.graphics.Rect;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.AdapterView;
@@ -40,6 +41,7 @@ import android.widget.AdapterView.OnItemLongClickListener;
import com.android.launcher.R;
import com.android.launcher2.FolderInfo.FolderListener;
import com.android.launcher2.Workspace.ShrinkState;
/**
* Represents a set of icons chosen by the user or generated by the system.
@@ -144,6 +146,14 @@ public class Folder extends LinearLayout implements DragSource, OnItemLongClickL
return true;
}
/**
* We need to handle touch events to prevent them from falling through to the workspace below.
*/
@Override
public boolean onTouchEvent(MotionEvent ev) {
return true;
}
public boolean onItemLongClick(AdapterView<?> parent, View view, int position, long id) {
if (!view.isInTouchMode()) {
return false;
@@ -353,7 +363,6 @@ public class Folder extends LinearLayout implements DragSource, OnItemLongClickL
}
findAndSetEmptyCells(item);
mInfo.add(item);
createAndAddShortcut(item);
LauncherModel.addOrMoveItemInDatabase(mLauncher, item, mInfo.id, 0, item.cellX, item.cellY);
}