Fixing weird deferred click events after deleting folder
-> Fixing issue 5055487 Change-Id: I932f95f29322fa50035b13063ab51fad2d2217e8
This commit is contained in:
@@ -31,6 +31,7 @@ import android.view.ViewConfiguration;
|
||||
import android.view.inputmethod.InputMethodManager;
|
||||
|
||||
import com.android.launcher.R;
|
||||
import com.android.launcher2.DropTarget.DragObject;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
@@ -81,7 +82,7 @@ public class DragController {
|
||||
*/
|
||||
private int mScrollZone;
|
||||
|
||||
private DropTarget.DragObject mDragObject = new DropTarget.DragObject();
|
||||
private DropTarget.DragObject mDragObject;
|
||||
|
||||
/** Who can receive drop events */
|
||||
private ArrayList<DropTarget> mDropTargets = new ArrayList<DropTarget>();
|
||||
@@ -275,6 +276,8 @@ public class DragController {
|
||||
|
||||
mDragging = true;
|
||||
|
||||
mDragObject = new DropTarget.DragObject();
|
||||
|
||||
mDragObject.dragComplete = false;
|
||||
mDragObject.xOffset = mMotionDownX - (dragLayerX + dragRegionLeft);
|
||||
mDragObject.yOffset = mMotionDownY - (dragLayerY + dragRegionTop);
|
||||
|
||||
@@ -1533,8 +1533,15 @@ public final class Launcher extends Activity
|
||||
* @param v The view representing the clicked shortcut.
|
||||
*/
|
||||
public void onClick(View v) {
|
||||
// Make sure that rogue clicks don't get through while allapps is launching
|
||||
if (mWorkspace.isSwitchingState()) return;
|
||||
// Make sure that rogue clicks don't get through while allapps is launching, or after the
|
||||
// view has detached (it's possible for this to happen if the view is removed mid touch).
|
||||
if (v.getWindowToken() == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (mWorkspace.isSwitchingState()) {
|
||||
return;
|
||||
}
|
||||
|
||||
Object tag = v.getTag();
|
||||
if (tag instanceof ShortcutInfo) {
|
||||
@@ -1692,6 +1699,7 @@ public final class Launcher extends Activity
|
||||
}
|
||||
|
||||
private void growAndFadeOutFolderIcon(FolderIcon fi) {
|
||||
if (fi == null) return;
|
||||
PropertyValuesHolder alpha = PropertyValuesHolder.ofFloat("alpha", 0);
|
||||
PropertyValuesHolder scaleX = PropertyValuesHolder.ofFloat("scaleX", 1.5f);
|
||||
PropertyValuesHolder scaleY = PropertyValuesHolder.ofFloat("scaleY", 1.5f);
|
||||
@@ -1708,6 +1716,7 @@ public final class Launcher extends Activity
|
||||
}
|
||||
|
||||
private void shrinkAndFadeInFolderIcon(FolderIcon fi) {
|
||||
if (fi == null) return;
|
||||
PropertyValuesHolder alpha = PropertyValuesHolder.ofFloat("alpha", 1.0f);
|
||||
PropertyValuesHolder scaleX = PropertyValuesHolder.ofFloat("scaleX", 1.0f);
|
||||
PropertyValuesHolder scaleY = PropertyValuesHolder.ofFloat("scaleY", 1.0f);
|
||||
|
||||
@@ -506,7 +506,7 @@ public class LauncherModel extends BroadcastReceiver {
|
||||
sFolders.remove(info.id);
|
||||
sWorkspaceItems.remove(info);
|
||||
|
||||
cr.delete(LauncherSettings.Favorites.CONTENT_URI,
|
||||
cr.delete(LauncherSettings.Favorites.CONTENT_URI_NO_NOTIFICATION,
|
||||
LauncherSettings.Favorites.CONTAINER + "=" + info.id, null);
|
||||
for (ItemInfo childInfo : info.contents) {
|
||||
sItemsIdMap.remove(childInfo.id);
|
||||
|
||||
Reference in New Issue
Block a user