summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJon Miranda <jonmiranda@google.com>2018-01-18 11:35:10 -0800
committerJon Miranda <jonmiranda@google.com>2018-01-18 14:15:45 -0800
commitde43a71b06cd1b5dd5fa38eb1e90c4b26bd99e53 (patch)
tree9c18216e41d268c4b74236870cee753d874ba413
parent69057173a732add164f83ddc926009c0cdca5e7c (diff)
downloadandroid_packages_apps_Trebuchet-de43a71b06cd1b5dd5fa38eb1e90c4b26bd99e53.tar.gz
android_packages_apps_Trebuchet-de43a71b06cd1b5dd5fa38eb1e90c4b26bd99e53.tar.bz2
android_packages_apps_Trebuchet-de43a71b06cd1b5dd5fa38eb1e90c4b26bd99e53.zip
Move scrim from DragLayer to LauncherRootView.
This change will make opening/closing animations a lot cleaner. Change-Id: I7f8ae301a9a126023833e282d6654bebd09bb306
-rw-r--r--quickstep/src/com/android/launcher3/LauncherAppTransitionManager.java8
-rw-r--r--res/layout-land/launcher.xml2
-rw-r--r--res/layout-port/launcher.xml2
-rw-r--r--res/layout-sw720dp/launcher.xml2
-rw-r--r--src/com/android/launcher3/Launcher.java6
-rw-r--r--src/com/android/launcher3/LauncherRootView.java9
-rw-r--r--src/com/android/launcher3/dragndrop/DragLayer.java7
7 files changed, 15 insertions, 21 deletions
diff --git a/quickstep/src/com/android/launcher3/LauncherAppTransitionManager.java b/quickstep/src/com/android/launcher3/LauncherAppTransitionManager.java
index d2777f08f..8ee1b85be 100644
--- a/quickstep/src/com/android/launcher3/LauncherAppTransitionManager.java
+++ b/quickstep/src/com/android/launcher3/LauncherAppTransitionManager.java
@@ -88,7 +88,6 @@ public class LauncherAppTransitionManager {
mDragLayer.setAlpha(1f);
mDragLayer.setTranslationY(0f);
- mDragLayer.getBackground().setAlpha(255);
finishedCallback.run();
}
});
@@ -118,12 +117,6 @@ public class LauncherAppTransitionManager {
private AnimatorSet getHideLauncherAnimator() {
AnimatorSet hideLauncher = new AnimatorSet();
- // Fade out the scrim fast to avoid the hard line
- ObjectAnimator scrimAlpha = ObjectAnimator.ofInt(mDragLayer.getBackground(),
- LauncherAnimUtils.DRAWABLE_ALPHA, 255, 0);
- scrimAlpha.setDuration(130);
- scrimAlpha.setInterpolator(Interpolators.AGGRESSIVE_EASE);
-
// Animate Launcher so that it moves downwards and fades out.
ObjectAnimator dragLayerAlpha = ObjectAnimator.ofFloat(mDragLayer, View.ALPHA, 1f, 0f);
dragLayerAlpha.setDuration(217);
@@ -133,7 +126,6 @@ public class LauncherAppTransitionManager {
dragLayerTransY.setInterpolator(Interpolators.AGGRESSIVE_EASE);
dragLayerTransY.setDuration(350);
- hideLauncher.play(scrimAlpha);
hideLauncher.play(dragLayerAlpha);
hideLauncher.play(dragLayerTransY);
return hideLauncher;
diff --git a/res/layout-land/launcher.xml b/res/layout-land/launcher.xml
index 9bd3c672b..f26bfbd0d 100644
--- a/res/layout-land/launcher.xml
+++ b/res/layout-land/launcher.xml
@@ -21,13 +21,13 @@
android:id="@+id/launcher"
android:layout_width="match_parent"
android:layout_height="match_parent"
+ android:background="?attr/workspaceStatusBarScrim"
android:fitsSystemWindows="true">
<com.android.launcher3.dragndrop.DragLayer
android:id="@+id/drag_layer"
android:clipChildren="false"
android:clipToPadding="false"
- android:background="?attr/workspaceStatusBarScrim"
android:importantForAccessibility="no"
android:layout_width="match_parent"
android:layout_height="match_parent">
diff --git a/res/layout-port/launcher.xml b/res/layout-port/launcher.xml
index b678398f9..cde3bd559 100644
--- a/res/layout-port/launcher.xml
+++ b/res/layout-port/launcher.xml
@@ -22,6 +22,7 @@
android:id="@+id/launcher"
android:layout_width="match_parent"
android:layout_height="match_parent"
+ android:background="?attr/workspaceStatusBarScrim"
android:fitsSystemWindows="true">
<com.android.launcher3.dragndrop.DragLayer
@@ -29,7 +30,6 @@
android:clipChildren="false"
android:importantForAccessibility="no"
android:clipToPadding="false"
- android:background="?attr/workspaceStatusBarScrim"
android:layout_width="match_parent"
android:layout_height="match_parent">
diff --git a/res/layout-sw720dp/launcher.xml b/res/layout-sw720dp/launcher.xml
index 7e6c659ad..fe2f10846 100644
--- a/res/layout-sw720dp/launcher.xml
+++ b/res/layout-sw720dp/launcher.xml
@@ -21,6 +21,7 @@
android:id="@+id/launcher"
android:layout_width="match_parent"
android:layout_height="match_parent"
+ android:background="?attr/workspaceStatusBarScrim"
android:fitsSystemWindows="true">
<com.android.launcher3.dragndrop.DragLayer
@@ -28,7 +29,6 @@
android:clipChildren="false"
android:clipToPadding="false"
android:importantForAccessibility="no"
- android:background="?attr/workspaceStatusBarScrim"
android:layout_width="match_parent"
android:layout_height="match_parent">
diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java
index bfd3d69f0..cf7486623 100644
--- a/src/com/android/launcher3/Launcher.java
+++ b/src/com/android/launcher3/Launcher.java
@@ -769,12 +769,12 @@ public class Launcher extends BaseActivity
mAppWidgetHost.setListenIfResumed(true);
NotificationListener.setNotificationsChangedListener(mPopupDataProvider);
- if (mShouldFadeInScrim && mDragLayer.getBackground() != null) {
+ if (mShouldFadeInScrim && mLauncherView.getBackground() != null) {
if (mScrimAnimator != null) {
mScrimAnimator.cancel();
}
- mDragLayer.getBackground().setAlpha(0);
- mScrimAnimator = ObjectAnimator.ofInt(mDragLayer.getBackground(),
+ mLauncherView.getBackground().setAlpha(0);
+ mScrimAnimator = ObjectAnimator.ofInt(mLauncherView.getBackground(),
LauncherAnimUtils.DRAWABLE_ALPHA, 0, 255);
mScrimAnimator.addListener(new AnimatorListenerAdapter() {
@Override
diff --git a/src/com/android/launcher3/LauncherRootView.java b/src/com/android/launcher3/LauncherRootView.java
index 1a1bec684..c2c8a7c96 100644
--- a/src/com/android/launcher3/LauncherRootView.java
+++ b/src/com/android/launcher3/LauncherRootView.java
@@ -11,6 +11,8 @@ import android.util.AttributeSet;
import android.view.View;
import android.view.ViewDebug;
+import com.android.launcher3.util.Themes;
+
import static com.android.launcher3.util.SystemUiController.FLAG_DARK_NAV;
import static com.android.launcher3.util.SystemUiController.UI_STATE_ROOT_VIEW;
@@ -81,6 +83,13 @@ public class LauncherRootView extends InsettableFrameLayout {
return true; // I'll take it from here
}
+ @Override
+ public void setInsets(Rect insets) {
+ super.setInsets(insets);
+ setBackground(insets.top == 0 ? null
+ : Themes.getAttrDrawable(getContext(), R.attr.workspaceStatusBarScrim));
+ }
+
public void dispatchInsets() {
fitSystemWindows(mInsets);
}
diff --git a/src/com/android/launcher3/dragndrop/DragLayer.java b/src/com/android/launcher3/dragndrop/DragLayer.java
index c75e61632..93a56791e 100644
--- a/src/com/android/launcher3/dragndrop/DragLayer.java
+++ b/src/com/android/launcher3/dragndrop/DragLayer.java
@@ -366,13 +366,6 @@ public class DragLayer extends InsettableFrameLayout {
}
@Override
- public void setInsets(Rect insets) {
- super.setInsets(insets);
- setBackground(insets.top == 0 ? null
- : Themes.getAttrDrawable(getContext(), R.attr.workspaceStatusBarScrim));
- }
-
- @Override
public LayoutParams generateLayoutParams(AttributeSet attrs) {
return new LayoutParams(getContext(), attrs);
}