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:
@@ -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();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -1482,6 +1482,7 @@ public final class Launcher extends Activity
|
||||
mWorkspace.unshrink(alreadyOnHome);
|
||||
}
|
||||
|
||||
mWorkspace.exitWidgetResizeMode();
|
||||
if (alreadyOnHome && mState == State.WORKSPACE && !mWorkspace.isTouchActive()) {
|
||||
mWorkspace.moveToDefaultScreen(true);
|
||||
}
|
||||
@@ -2020,6 +2021,8 @@ public final class Launcher extends Activity
|
||||
dismissPreview(mPreviousView);
|
||||
dismissPreview(mNextView);
|
||||
} else {
|
||||
mWorkspace.exitWidgetResizeMode();
|
||||
|
||||
// Back button is a no-op here, but give at least some feedback for the button press
|
||||
mWorkspace.showOutlinesTemporarily();
|
||||
}
|
||||
|
||||
@@ -1790,6 +1790,11 @@ public class Workspace extends SmoothPagedView
|
||||
}
|
||||
}
|
||||
|
||||
public void exitWidgetResizeMode() {
|
||||
final CellLayout currentLayout = (CellLayout) getChildAt(getCurrentPage());
|
||||
currentLayout.getChildrenLayout().clearAllResizeFrames();
|
||||
}
|
||||
|
||||
void unshrink(boolean animated) {
|
||||
unshrink(animated, false);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user