Merge "Move scrim from DragLayer to LauncherRootView." into ub-launcher3-master
This commit is contained in:
committed by
Android (Google) Code Review
commit
dbcd632214
@@ -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;
|
||||
|
||||
@@ -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">
|
||||
|
||||
@@ -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">
|
||||
|
||||
|
||||
@@ -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">
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -365,13 +365,6 @@ public class DragLayer extends InsettableFrameLayout {
|
||||
return isContainerOpen || mDragController.dispatchUnhandledMove(focused, direction);
|
||||
}
|
||||
|
||||
@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);
|
||||
|
||||
Reference in New Issue
Block a user