summaryrefslogtreecommitdiffstats
path: root/src/com/android
diff options
context:
space:
mode:
authorSunny Goyal <sunnygoyal@google.com>2019-05-22 15:17:52 -0700
committerSunny Goyal <sunnygoyal@google.com>2019-05-22 15:21:56 -0700
commitbe8c34077cb06da736053926f931c3e4f0be44dc (patch)
treee6139e9093db238623bdc9642cb7aa226338efa9 /src/com/android
parent07b985b5e5763bafec786d52b8f65fdcff2d1b14 (diff)
downloadandroid_packages_apps_Trebuchet-be8c34077cb06da736053926f931c3e4f0be44dc.tar.gz
android_packages_apps_Trebuchet-be8c34077cb06da736053926f931c3e4f0be44dc.tar.bz2
android_packages_apps_Trebuchet-be8c34077cb06da736053926f931c3e4f0be44dc.zip
Lock launcher rotation during activity transition to allow
proper seamless transition at the end Bug: 131360075 Change-Id: I2b76d4b3e0528e56b7b4709fd3708bc858bf1612
Diffstat (limited to 'src/com/android')
-rw-r--r--src/com/android/launcher3/Launcher.java6
-rw-r--r--src/com/android/launcher3/states/RotationHelper.java14
-rw-r--r--src/com/android/launcher3/views/FloatingIconView.java2
3 files changed, 20 insertions, 2 deletions
diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java
index 40eb912df..07bacf325 100644
--- a/src/com/android/launcher3/Launcher.java
+++ b/src/com/android/launcher3/Launcher.java
@@ -29,6 +29,7 @@ import static com.android.launcher3.LauncherState.OVERVIEW_PEEK;
import static com.android.launcher3.dragndrop.DragLayer.ALPHA_INDEX_LAUNCHER_LOAD;
import static com.android.launcher3.logging.LoggerUtils.newContainerTarget;
import static com.android.launcher3.logging.LoggerUtils.newTarget;
+import static com.android.launcher3.states.RotationHelper.REQUEST_NONE;
import static com.android.launcher3.util.RaceConditionTracker.ENTER;
import static com.android.launcher3.util.RaceConditionTracker.EXIT;
@@ -76,8 +77,6 @@ import android.view.accessibility.AccessibilityEvent;
import android.view.animation.OvershootInterpolator;
import android.widget.Toast;
-import androidx.annotation.Nullable;
-
import com.android.launcher3.DropTarget.DragObject;
import com.android.launcher3.accessibility.LauncherAccessibilityDelegate;
import com.android.launcher3.allapps.AllAppsContainerView;
@@ -154,6 +153,8 @@ import java.util.HashSet;
import java.util.List;
import java.util.function.Predicate;
+import androidx.annotation.Nullable;
+
/**
* Default launcher application.
*/
@@ -406,6 +407,7 @@ public class Launcher extends BaseDraggingActivity implements LauncherExterns,
super.onEnterAnimationComplete();
UiFactory.onEnterAnimationComplete(this);
mAllAppsController.highlightWorkTabIfNecessary();
+ mRotationHelper.setCurrentTransitionRequest(REQUEST_NONE);
}
@Override
diff --git a/src/com/android/launcher3/states/RotationHelper.java b/src/com/android/launcher3/states/RotationHelper.java
index 3727fa663..b6c3c35b8 100644
--- a/src/com/android/launcher3/states/RotationHelper.java
+++ b/src/com/android/launcher3/states/RotationHelper.java
@@ -63,6 +63,10 @@ public class RotationHelper implements OnSharedPreferenceChangeListener {
*/
private int mStateHandlerRequest = REQUEST_NONE;
/**
+ * Rotation request made by an app transition
+ */
+ private int mCurrentTransitionRequest = REQUEST_NONE;
+ /**
* Rotation request made by a Launcher State
*/
private int mCurrentStateRequest = REQUEST_NONE;
@@ -123,6 +127,13 @@ public class RotationHelper implements OnSharedPreferenceChangeListener {
}
}
+ public void setCurrentTransitionRequest(int request) {
+ if (mCurrentTransitionRequest != request) {
+ mCurrentTransitionRequest = request;
+ notifyChange();
+ }
+ }
+
public void setCurrentStateRequest(int request) {
if (mCurrentStateRequest != request) {
mCurrentStateRequest = request;
@@ -163,6 +174,9 @@ public class RotationHelper implements OnSharedPreferenceChangeListener {
if (mStateHandlerRequest != REQUEST_NONE) {
activityFlags = mStateHandlerRequest == REQUEST_LOCK ?
SCREEN_ORIENTATION_LOCKED : SCREEN_ORIENTATION_UNSPECIFIED;
+ } else if (mCurrentTransitionRequest != REQUEST_NONE) {
+ activityFlags = mCurrentTransitionRequest == REQUEST_LOCK ?
+ SCREEN_ORIENTATION_LOCKED : SCREEN_ORIENTATION_UNSPECIFIED;
} else if (mCurrentStateRequest == REQUEST_LOCK) {
activityFlags = SCREEN_ORIENTATION_LOCKED;
} else if (mIgnoreAutoRotateSettings || mCurrentStateRequest == REQUEST_ROTATE
diff --git a/src/com/android/launcher3/views/FloatingIconView.java b/src/com/android/launcher3/views/FloatingIconView.java
index 3d5877a59..3b18621af 100644
--- a/src/com/android/launcher3/views/FloatingIconView.java
+++ b/src/com/android/launcher3/views/FloatingIconView.java
@@ -20,6 +20,7 @@ import static com.android.launcher3.Utilities.getBadge;
import static com.android.launcher3.Utilities.mapToRange;
import static com.android.launcher3.anim.Interpolators.LINEAR;
import static com.android.launcher3.config.FeatureFlags.ADAPTIVE_ICON_WINDOW_ANIM;
+import static com.android.launcher3.states.RotationHelper.REQUEST_LOCK;
import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
@@ -169,6 +170,7 @@ public class FloatingIconView extends View implements
protected void onAttachedToWindow() {
super.onAttachedToWindow();
getViewTreeObserver().addOnGlobalLayoutListener(this);
+ mLauncher.getRotationHelper().setCurrentTransitionRequest(REQUEST_LOCK);
}
@Override