Merge "Remove scaffolding for multiple dots" into tm-qpr-dev am: 86ab34d0ff
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/20278759 Change-Id: I7770054e780bbd30331363643fed7c3e388e7d35 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -805,7 +805,7 @@ public class NotificationShelf extends ActivatableNotificationView implements
|
||||
iconState.hidden = isAppearing
|
||||
|| (view instanceof ExpandableNotificationRow
|
||||
&& ((ExpandableNotificationRow) view).isLowPriority()
|
||||
&& mShelfIcons.hasMaxNumDot())
|
||||
&& mShelfIcons.areIconsOverflowing())
|
||||
|| (transitionAmount == 0.0f && !iconState.isAnimating(icon))
|
||||
|| row.isAboveShelf()
|
||||
|| row.showingPulsing()
|
||||
|
||||
@@ -141,7 +141,6 @@ public class NotificationIconContainer extends ViewGroup {
|
||||
/* Maximum number of icons in short shelf on lockscreen when also showing overflow dot. */
|
||||
public static final int MAX_ICONS_ON_LOCKSCREEN = 3;
|
||||
public static final int MAX_STATIC_ICONS = 4;
|
||||
private static final int MAX_DOTS = 1;
|
||||
|
||||
private boolean mIsStaticLayout = true;
|
||||
private final HashMap<View, IconState> mIconStates = new HashMap<>();
|
||||
@@ -166,8 +165,7 @@ public class NotificationIconContainer extends ViewGroup {
|
||||
private IconState mLastVisibleIconState;
|
||||
private IconState mFirstVisibleIconState;
|
||||
private float mVisualOverflowStart;
|
||||
// Keep track of overflow in range [0, 3]
|
||||
private int mNumDots;
|
||||
private boolean mIsShowingOverflowDot;
|
||||
private StatusBarIconView mIsolatedIcon;
|
||||
private Rect mIsolatedIconLocation;
|
||||
private int[] mAbsolutePosition = new int[2];
|
||||
@@ -387,8 +385,8 @@ public class NotificationIconContainer extends ViewGroup {
|
||||
}
|
||||
}
|
||||
|
||||
public boolean hasMaxNumDot() {
|
||||
return mNumDots >= MAX_DOTS;
|
||||
public boolean areIconsOverflowing() {
|
||||
return mIsShowingOverflowDot;
|
||||
}
|
||||
|
||||
private boolean areAnimationsEnabled(StatusBarIconView icon) {
|
||||
@@ -494,7 +492,7 @@ public class NotificationIconContainer extends ViewGroup {
|
||||
: 1f;
|
||||
translationX += iconState.iconAppearAmount * view.getWidth() * drawingScale;
|
||||
}
|
||||
mNumDots = 0;
|
||||
mIsShowingOverflowDot = false;
|
||||
if (firstOverflowIndex != -1) {
|
||||
translationX = mVisualOverflowStart;
|
||||
for (int i = firstOverflowIndex; i < childCount; i++) {
|
||||
@@ -502,15 +500,14 @@ public class NotificationIconContainer extends ViewGroup {
|
||||
IconState iconState = mIconStates.get(view);
|
||||
int dotWidth = mStaticDotDiameter + mDotPadding;
|
||||
iconState.setXTranslation(translationX);
|
||||
if (mNumDots < MAX_DOTS) {
|
||||
if (mNumDots == 0 && iconState.iconAppearAmount < 0.8f) {
|
||||
if (!mIsShowingOverflowDot) {
|
||||
if (iconState.iconAppearAmount < 0.8f) {
|
||||
iconState.visibleState = StatusBarIconView.STATE_ICON;
|
||||
} else {
|
||||
iconState.visibleState = StatusBarIconView.STATE_DOT;
|
||||
mNumDots++;
|
||||
mIsShowingOverflowDot = true;
|
||||
}
|
||||
translationX += (mNumDots == MAX_DOTS ? MAX_DOTS * dotWidth : dotWidth)
|
||||
* iconState.iconAppearAmount;
|
||||
translationX += dotWidth * iconState.iconAppearAmount;
|
||||
mLastVisibleIconState = iconState;
|
||||
} else {
|
||||
iconState.visibleState = StatusBarIconView.STATE_HIDDEN;
|
||||
@@ -618,10 +615,6 @@ public class NotificationIconContainer extends ViewGroup {
|
||||
return Math.min(getWidth(), translation);
|
||||
}
|
||||
|
||||
private float getMaxOverflowStart() {
|
||||
return getLayoutEnd() - mIconSize;
|
||||
}
|
||||
|
||||
public void setChangingViewPositions(boolean changingViewPositions) {
|
||||
mChangingViewPositions = changingViewPositions;
|
||||
}
|
||||
@@ -645,25 +638,6 @@ public class NotificationIconContainer extends ViewGroup {
|
||||
mSpeedBumpIndex = speedBumpIndex;
|
||||
}
|
||||
|
||||
public boolean hasOverflow() {
|
||||
return mNumDots > 0;
|
||||
}
|
||||
|
||||
// Give some extra room for btw notifications if we can
|
||||
public int getNoOverflowExtraPadding() {
|
||||
if (mNumDots != 0) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
int collapsedPadding = mIconSize;
|
||||
|
||||
if (collapsedPadding + getFinalTranslationX() > getWidth()) {
|
||||
collapsedPadding = getWidth() - getFinalTranslationX();
|
||||
}
|
||||
|
||||
return collapsedPadding;
|
||||
}
|
||||
|
||||
public int getIconSize() {
|
||||
return mIconSize;
|
||||
}
|
||||
|
||||
@@ -92,7 +92,7 @@ class NotificationIconContainerTest : SysuiTestCase() {
|
||||
|
||||
iconContainer.calculateIconXTranslations()
|
||||
assertEquals(10f, iconState.xTranslation)
|
||||
assertFalse(iconContainer.hasOverflow())
|
||||
assertFalse(iconContainer.areIconsOverflowing())
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -121,7 +121,7 @@ class NotificationIconContainerTest : SysuiTestCase() {
|
||||
assertEquals(30f, iconContainer.getIconState(iconThree).xTranslation)
|
||||
assertEquals(40f, iconContainer.getIconState(iconFour).xTranslation)
|
||||
|
||||
assertFalse(iconContainer.hasOverflow())
|
||||
assertFalse(iconContainer.areIconsOverflowing())
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -150,7 +150,7 @@ class NotificationIconContainerTest : SysuiTestCase() {
|
||||
assertEquals(10f, iconContainer.getIconState(iconOne).xTranslation)
|
||||
assertEquals(20f, iconContainer.getIconState(iconTwo).xTranslation)
|
||||
assertEquals(30f, iconContainer.getIconState(iconThree).xTranslation)
|
||||
assertTrue(iconContainer.hasOverflow())
|
||||
assertTrue(iconContainer.areIconsOverflowing())
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
Reference in New Issue
Block a user