diff options
author | Adam Cohen <adamcohen@google.com> | 2011-05-05 10:34:16 -0700 |
---|---|---|
committer | Adam Cohen <adamcohen@google.com> | 2011-05-05 10:34:16 -0700 |
commit | 0c872ba544ecfd9b106bb66137da8680927590de (patch) | |
tree | b6f7b8b0020ea3508eb466f62e75faa7644f79b9 /src | |
parent | 1c4b6efb18ee841e8c83e9e60a171caac9051e04 (diff) | |
download | android_packages_apps_Trebuchet-0c872ba544ecfd9b106bb66137da8680927590de.tar.gz android_packages_apps_Trebuchet-0c872ba544ecfd9b106bb66137da8680927590de.tar.bz2 android_packages_apps_Trebuchet-0c872ba544ecfd9b106bb66137da8680927590de.zip |
Fixing small folder bugs
-> Preventing duplicate item adds
-> Stopping touch events from falling through to workspace
Change-Id: I0326a1bf442b1705d3790a701649788413e7a633
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/launcher2/Folder.java | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/com/android/launcher2/Folder.java b/src/com/android/launcher2/Folder.java index 5a4358d2f..3a8a68d56 100644 --- a/src/com/android/launcher2/Folder.java +++ b/src/com/android/launcher2/Folder.java @@ -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); } |