From daa8f09bcdd8afffea9cbeec8338a040d457dc86 Mon Sep 17 00:00:00 2001 From: Fabian Kozynski Date: Fri, 7 May 2021 10:05:23 -0400 Subject: Change scroll animation Test: manual Fixes: 187334034 Change-Id: I4bb4a2a779a2542a53dd0304a185388c61de371b --- .../com/android/systemui/qs/QSContainerImpl.java | 7 ++--- .../android/systemui/qs/QuickStatusBarHeader.java | 31 +++------------------- 2 files changed, 5 insertions(+), 33 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/qs/QSContainerImpl.java b/packages/SystemUI/src/com/android/systemui/qs/QSContainerImpl.java index dd1a4af18f7f..c459963f7217 100644 --- a/packages/SystemUI/src/com/android/systemui/qs/QSContainerImpl.java +++ b/packages/SystemUI/src/com/android/systemui/qs/QSContainerImpl.java @@ -196,13 +196,10 @@ public class QSContainerImpl extends FrameLayout { void updateResources(QSPanelController qsPanelController, QuickStatusBarHeaderController quickStatusBarHeaderController) { - LayoutParams layoutParams = (LayoutParams) mQSPanelContainer.getLayoutParams(); - layoutParams.topMargin = mContext.getResources().getDimensionPixelSize( - com.android.internal.R.dimen.quick_qs_offset_height); - mQSPanelContainer.setLayoutParams(layoutParams); mQSPanelContainer.setPaddingRelative( mQSPanelContainer.getPaddingStart(), - mQSPanelContainer.getPaddingTop(), + mContext.getResources().getDimensionPixelSize( + com.android.internal.R.dimen.quick_qs_offset_height), mQSPanelContainer.getPaddingEnd(), mContext.getResources().getDimensionPixelSize(R.dimen.qs_container_bottom_padding) ); diff --git a/packages/SystemUI/src/com/android/systemui/qs/QuickStatusBarHeader.java b/packages/SystemUI/src/com/android/systemui/qs/QuickStatusBarHeader.java index 73a6b34c612e..fc4be784c84f 100644 --- a/packages/SystemUI/src/com/android/systemui/qs/QuickStatusBarHeader.java +++ b/packages/SystemUI/src/com/android/systemui/qs/QuickStatusBarHeader.java @@ -23,7 +23,6 @@ import android.content.res.Resources; import android.graphics.Color; import android.graphics.Rect; import android.util.AttributeSet; -import android.util.MathUtils; import android.util.Pair; import android.view.DisplayCutout; import android.view.View; @@ -36,7 +35,6 @@ import android.widget.Space; import com.android.settingslib.Utils; import com.android.systemui.BatteryMeterView; import com.android.systemui.R; -import com.android.systemui.animation.Interpolators; import com.android.systemui.qs.QSDetail.Callback; import com.android.systemui.statusbar.StatusBarIconView; import com.android.systemui.statusbar.phone.StatusBarIconController.TintedIconManager; @@ -80,7 +78,7 @@ public class QuickStatusBarHeader extends FrameLayout { private int mWaterfallTopInset; private int mCutOutPaddingLeft; private int mCutOutPaddingRight; - private float mClockIconsAlpha = 1.0f; + private float mViewAlpha = 1.0f; private float mKeyguardExpansionFraction; private int mTextColorPrimary = Color.TRANSPARENT; private int mTopViewMeasureHeight; @@ -408,35 +406,12 @@ public class QuickStatusBarHeader extends FrameLayout { } /** - * When QS is scrolling, mClockIconsAlpha should scroll away and fade out. - * - * For a given scroll level, this method does the following: - *
    - *
  1. Determine the alpha that {@code mClockIconsView} should have when the panel is fully - * expanded.
  2. - *
  3. Set the scroll of {@code mClockIconsView} to the same of {@code QSPanel}.
  4. - *
  5. Set the alpha of {@code mClockIconsView} to that determined by the expansion of - * the panel, interpolated between 1 (no expansion) and {@code mClockIconsAlpha} (fully - * expanded), matching the animator.
  6. - *
+ * Scroll the headers away. * * @param scrollY the scroll of the QSPanel container */ public void setExpandedScrollAmount(int scrollY) { - // The scrolling of the expanded qs has changed. Since the header text isn't part of it, - // but would overlap content, we're fading it out. - float newAlpha = 1.0f; - if (mClockIconsView.getHeight() > 0) { - newAlpha = MathUtils.map(0, mClockIconsView.getHeight() / 2.0f, 1.0f, 0.0f, - scrollY); - newAlpha = Interpolators.ALPHA_OUT.getInterpolation(newAlpha); - } mClockIconsView.setScrollY(scrollY); - if (newAlpha != mClockIconsAlpha) { - mClockIconsAlpha = newAlpha; - mClockIconsView.setAlpha(MathUtils.lerp(1.0f, mClockIconsAlpha, - mKeyguardExpansionFraction)); - updateAlphaAnimator(); - } + mDatePrivacyView.setScrollY(scrollY); } } -- cgit v1.2.3-59-g8ed1b