Merge "Fix 4020235: NPE at com.android.launcher2.DragLayer.onInterceptTouchEvent" into honeycomb-mr1

This commit is contained in:
Patrick Dubroy
2011-03-07 15:16:00 -08:00
committed by Android (Google) Code Review
+11 -9
View File
@@ -62,17 +62,19 @@ public class DragLayer extends FrameLayout {
// event has occurred which doesn't result in resizing a widget. In this case, we
// dismiss any visible resize frames.
final Workspace w = (Workspace) findViewById(R.id.workspace);
final CellLayout currentPage = (CellLayout) w.getChildAt(w.getCurrentPage());
final CellLayoutChildren childrenLayout = currentPage.getChildrenLayout();
if (w != null) {
final CellLayout currentPage = (CellLayout) w.getChildAt(w.getCurrentPage());
final CellLayoutChildren childrenLayout = currentPage.getChildrenLayout();
if (childrenLayout.hasResizeFrames() && !childrenLayout.isWidgetBeingResized()) {
post(new Runnable() {
public void run() {
if (!childrenLayout.isWidgetBeingResized()) {
childrenLayout.clearAllResizeFrames();
if (childrenLayout.hasResizeFrames() && !childrenLayout.isWidgetBeingResized()) {
post(new Runnable() {
public void run() {
if (!childrenLayout.isWidgetBeingResized()) {
childrenLayout.clearAllResizeFrames();
}
}
}
});
});
}
}
return mDragController.onInterceptTouchEvent(ev);
}