Don't scale notifications on Keyguard for devices < xxhdpi
Bug: 16824061
Change-Id: Iccccebcd17357764aef325df0cd220508fcf7403
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/stack/StackScrollAlgorithm.java b/packages/SystemUI/src/com/android/systemui/statusbar/stack/StackScrollAlgorithm.java
index f984339b3..fc2be1a 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/stack/StackScrollAlgorithm.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/stack/StackScrollAlgorithm.java
@@ -17,6 +17,7 @@
package com.android.systemui.statusbar.stack;
import android.content.Context;
+import android.util.DisplayMetrics;
import android.util.Log;
import android.view.View;
import android.view.ViewGroup;
@@ -73,6 +74,7 @@
private int mCollapseSecondCardPadding;
private boolean mIsSmallScreen;
private int mMaxNotificationHeight;
+ private boolean mScaleDimmed;
public StackScrollAlgorithm(Context context) {
initConstants(context);
@@ -80,7 +82,7 @@
}
private void updatePadding(boolean dimmed) {
- mPaddingBetweenElements = dimmed
+ mPaddingBetweenElements = dimmed && mScaleDimmed
? mPaddingBetweenElementsDimmed
: mPaddingBetweenElementsNormal;
mTopStackTotalSize = mTopStackSlowDownLength + mPaddingBetweenElements
@@ -125,8 +127,13 @@
R.dimen.notification_material_rounded_rect_radius);
mCollapseSecondCardPadding = context.getResources().getDimensionPixelSize(
R.dimen.notification_collapse_second_card_padding);
+ mScaleDimmed = context.getResources().getDisplayMetrics().densityDpi
+ >= DisplayMetrics.DENSITY_XXHIGH;
}
+ public boolean shouldScaleDimmed() {
+ return mScaleDimmed;
+ }
public void getStackScrollState(AmbientState ambientState, StackScrollState resultState) {
// The state of the local variables are saved in an algorithmState to easily subdivide it
@@ -271,7 +278,7 @@
childViewState.dark = dark;
childViewState.hideSensitive = hideSensitive;
boolean isActivatedChild = activatedChild == child;
- childViewState.scale = !dimmed || isActivatedChild
+ childViewState.scale = !mScaleDimmed || !dimmed || isActivatedChild
? 1.0f
: DIMMED_SCALE;
if (dimmed && activatedChild != null) {