summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWinson Chung <winsonc@google.com>2012-04-26 15:58:01 -0700
committerWinson Chung <winsonc@google.com>2012-04-26 15:58:34 -0700
commit641d71d6da6c77cc32e5d0f65ccae89caed1ac34 (patch)
tree318810dcb1448ccb72a0e86db3b7dccf63a2dd5f
parent840ebf6277c8eea38b6a4f03cd8bb4e09bd69c7d (diff)
downloadandroid_packages_apps_Trebuchet-641d71d6da6c77cc32e5d0f65ccae89caed1ac34.tar.gz
android_packages_apps_Trebuchet-641d71d6da6c77cc32e5d0f65ccae89caed1ac34.tar.bz2
android_packages_apps_Trebuchet-641d71d6da6c77cc32e5d0f65ccae89caed1ac34.zip
Preventing activity from rotating while the user is dragging an item. (Bug 6240922)
Change-Id: Id487e8809c059cecb3310afe098edd0eaf085c90
-rw-r--r--src/com/android/launcher2/AppsCustomizePagedView.java4
-rw-r--r--src/com/android/launcher2/Launcher.java22
-rw-r--r--src/com/android/launcher2/Workspace.java4
3 files changed, 13 insertions, 17 deletions
diff --git a/src/com/android/launcher2/AppsCustomizePagedView.java b/src/com/android/launcher2/AppsCustomizePagedView.java
index 7b71ff47e..4958f03e0 100644
--- a/src/com/android/launcher2/AppsCustomizePagedView.java
+++ b/src/com/android/launcher2/AppsCustomizePagedView.java
@@ -706,7 +706,7 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen
// Start the drag
alphaClipPaint = null;
- mLauncher.lockScreenOrientationOnLargeUI();
+ mLauncher.lockScreenOrientation();
mLauncher.getWorkspace().onDragStartedWithItem(createItemInfo, outline, alphaClipPaint);
mDragController.startDrag(image, preview, this, createItemInfo,
DragController.DRAG_ACTION_COPY, null, scale);
@@ -758,7 +758,7 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen
// drop in Workspace
mLauncher.exitSpringLoadedDragMode();
}
- mLauncher.unlockScreenOrientationOnLargeUI();
+ mLauncher.unlockScreenOrientation();
}
@Override
diff --git a/src/com/android/launcher2/Launcher.java b/src/com/android/launcher2/Launcher.java
index 7b9b36e87..f60516014 100644
--- a/src/com/android/launcher2/Launcher.java
+++ b/src/com/android/launcher2/Launcher.java
@@ -3300,20 +3300,16 @@ public final class Launcher extends Activity
return oriMap[(d.getRotation() + indexOffset) % 4];
}
- public void lockScreenOrientationOnLargeUI() {
- if (LauncherApplication.isScreenLarge()) {
- setRequestedOrientation(mapConfigurationOriActivityInfoOri(getResources()
- .getConfiguration().orientation));
- }
+ public void lockScreenOrientation() {
+ setRequestedOrientation(mapConfigurationOriActivityInfoOri(getResources()
+ .getConfiguration().orientation));
}
- public void unlockScreenOrientationOnLargeUI() {
- if (LauncherApplication.isScreenLarge()) {
- mHandler.postDelayed(new Runnable() {
- public void run() {
- setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED);
- }
- }, mRestoreScreenOrientationDelay);
- }
+ public void unlockScreenOrientation() {
+ mHandler.postDelayed(new Runnable() {
+ public void run() {
+ setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED);
+ }
+ }, mRestoreScreenOrientationDelay);
}
/* Cling related */
diff --git a/src/com/android/launcher2/Workspace.java b/src/com/android/launcher2/Workspace.java
index 8be002c97..f5c845e53 100644
--- a/src/com/android/launcher2/Workspace.java
+++ b/src/com/android/launcher2/Workspace.java
@@ -375,13 +375,13 @@ public class Workspace extends SmoothPagedView
public void onDragStart(DragSource source, Object info, int dragAction) {
mIsDragOccuring = true;
updateChildrenLayersEnabled();
- mLauncher.lockScreenOrientationOnLargeUI();
+ mLauncher.lockScreenOrientation();
}
public void onDragEnd() {
mIsDragOccuring = false;
updateChildrenLayersEnabled();
- mLauncher.unlockScreenOrientationOnLargeUI();
+ mLauncher.unlockScreenOrientation();
}
/**