Fix 3511340: Exit widget resize mode when home or back clicked

Also add an optimization to drastically reduce the number of
posted events when a widget is currently being resized.

Change-Id: I8839d4bba564028a67fb0355d35b7dd52465b199
This commit is contained in:
Patrick Dubroy
2011-03-03 19:54:56 -08:00
parent c50d9573b3
commit 758a9239f0
3 changed files with 12 additions and 3 deletions

View File

@@ -63,12 +63,13 @@ public class DragLayer extends FrameLayout {
// 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 (currentPage.getChildrenLayout().hasResizeFrames()) {
if (childrenLayout.hasResizeFrames() && !childrenLayout.isWidgetBeingResized()) {
post(new Runnable() {
public void run() {
if (!currentPage.getChildrenLayout().isWidgetBeingResized()) {
currentPage.getChildrenLayout().clearAllResizeFrames();
if (!childrenLayout.isWidgetBeingResized()) {
childrenLayout.clearAllResizeFrames();
}
}
});