diff options
author | Mario Bertschler <bmario@google.com> | 2017-05-24 17:56:56 +0000 |
---|---|---|
committer | Mario Bertschler <bmario@google.com> | 2017-05-24 17:56:56 +0000 |
commit | 418d443d2fdf4bade836eef35ec6732ae07a73fe (patch) | |
tree | ec8de68c073ee89ca98de97fa606657ab430ce4a | |
parent | d15dccf10eec367e38b8723c409909a29307057a (diff) | |
download | android_packages_apps_Trebuchet-418d443d2fdf4bade836eef35ec6732ae07a73fe.tar.gz android_packages_apps_Trebuchet-418d443d2fdf4bade836eef35ec6732ae07a73fe.tar.bz2 android_packages_apps_Trebuchet-418d443d2fdf4bade836eef35ec6732ae07a73fe.zip |
Revert "Allapps motion changes for landscape"
This reverts commit d15dccf10eec367e38b8723c409909a29307057a.
Change-Id: I04c06d419bc636929259bc5f4fdce982d97ef33f
-rw-r--r-- | res/layout/gradient_scrim.xml | 3 | ||||
-rw-r--r-- | src/com/android/launcher3/graphics/ScrimView.java | 49 |
2 files changed, 6 insertions, 46 deletions
diff --git a/res/layout/gradient_scrim.xml b/res/layout/gradient_scrim.xml index 15516b028..c40c5fc0c 100644 --- a/res/layout/gradient_scrim.xml +++ b/res/layout/gradient_scrim.xml @@ -26,5 +26,6 @@ android:id="@+id/scrim_bg" android:layout_width="match_parent" android:layout_height="match_parent" - android:visibility="gone"/> + android:visibility="gone" + app:layout_ignoreInsets="true"/> </merge>
\ No newline at end of file diff --git a/src/com/android/launcher3/graphics/ScrimView.java b/src/com/android/launcher3/graphics/ScrimView.java index c102cabb1..feb3f030f 100644 --- a/src/com/android/launcher3/graphics/ScrimView.java +++ b/src/com/android/launcher3/graphics/ScrimView.java @@ -29,12 +29,10 @@ import android.view.View; import android.view.animation.AccelerateInterpolator; import android.view.animation.Interpolator; -import com.android.launcher3.DeviceProfile; -import com.android.launcher3.Launcher; import com.android.launcher3.R; import com.android.launcher3.Utilities; -public class ScrimView extends View implements DeviceProfile.LauncherLayoutChangeListener { +public class ScrimView extends View { private static final boolean DEBUG = false; @@ -59,10 +57,6 @@ public class ScrimView extends View implements DeviceProfile.LauncherLayoutChang private final Interpolator mAccelerator = new AccelerateInterpolator(); private final Paint mDebugPaint = DEBUG ? new Paint() : null; - private int mPaddingLeft; - private int mPaddingRight; - private int mAlphaStart; - public ScrimView(Context context, AttributeSet attrs) { super(context, attrs); mMaskHeight = Utilities.pxFromDp(MASK_HEIGHT_DP, getResources().getDisplayMetrics()); @@ -81,21 +75,6 @@ public class ScrimView extends View implements DeviceProfile.LauncherLayoutChang } @Override - protected void onAttachedToWindow() { - super.onAttachedToWindow(); - updatePaddingAndAlphaStart(); - Launcher.getLauncher(getContext()).getDeviceProfile() - .addLauncherLayoutChangedListener(this); - } - - @Override - protected void onDetachedFromWindow() { - super.onDetachedFromWindow(); - Launcher.getLauncher(getContext()).getDeviceProfile() - .removeLauncherLayoutChangedListener(this); - } - - @Override protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { super.onMeasure(widthMeasureSpec, heightMeasureSpec); int width = MeasureSpec.getSize(widthMeasureSpec); @@ -112,8 +91,7 @@ public class ScrimView extends View implements DeviceProfile.LauncherLayoutChang setTranslationY(linTranslationY); if (APPLY_ALPHA) { - int alpha = mAlphaStart + (int) ((255f - mAlphaStart) - * mAccelerator.getInterpolation(progress)); + int alpha = 55 + (int) (200f * mAccelerator.getInterpolation(progress)); mPaint.setAlpha(alpha); invalidate(); } @@ -121,8 +99,8 @@ public class ScrimView extends View implements DeviceProfile.LauncherLayoutChang @Override protected void onDraw(Canvas canvas) { - mAlphaMaskRect.set(mPaddingLeft, 0, getWidth() - mPaddingRight, mMaskHeight); - mFinalMaskRect.set(mPaddingLeft, mMaskHeight, getWidth() - mPaddingRight, getHeight()); + mAlphaMaskRect.set(0, 0, getWidth(), mMaskHeight); + mFinalMaskRect.set(0, mMaskHeight, getWidth(), getHeight()); canvas.drawBitmap(sAlphaScrimMask, null, mAlphaMaskRect, mPaint); canvas.drawBitmap(sFinalScrimMask, null, mFinalMaskRect, mPaint); @@ -133,23 +111,4 @@ public class ScrimView extends View implements DeviceProfile.LauncherLayoutChang } } - @Override - public void onLauncherLayoutChanged() { - updatePaddingAndAlphaStart(); - invalidate(); - } - - private void updatePaddingAndAlphaStart() { - DeviceProfile grid = Launcher.getLauncher(getContext()).getDeviceProfile(); - if (grid.isVerticalBarLayout()) { - int[] padding = grid.getContainerPadding(); - mPaddingLeft = padding[0] + grid.edgeMarginPx; - mPaddingRight = padding[1] + grid.edgeMarginPx; - mAlphaStart = 0; - } else { - mPaddingLeft = 0; - mPaddingRight = 0; - mAlphaStart = 55; - } - } } |