Fixed a bug where a notification could not be collapsed

Also fixed a bug where the content height was wrongly
calculated when the dismissview was invisible.
Finally refined the appearance when more then 2 huns
are present.
Change-Id: If66243beef2383f2cb36961deffcb0a42bbcd177
This commit is contained in:
Selim Cinek
2015-04-13 16:14:26 -07:00
parent fbe9a44a15
commit e53e6bbb82
4 changed files with 6 additions and 10 deletions

View File

@@ -322,8 +322,7 @@ public class ExpandHelper implements Gefingerpoken {
isInside(mScrollAdapter.getHostView(), x, y)
&& mScrollAdapter.isScrolledToTop();
mResizedView = findView(x, y);
if (mResizedView != null && (isFullyExpanded(mResizedView)
|| !mCallback.canChildBeExpanded(mResizedView))) {
if (mResizedView != null && !mCallback.canChildBeExpanded(mResizedView)) {
mResizedView = null;
mWatchingForPull = false;
}

View File

@@ -98,7 +98,7 @@ public class HeadsUpManager implements ViewTreeObserver.OnComputeInternalInsetsL
mDefaultSnoozeLengthMs = resources.getInteger(R.integer.heads_up_default_snooze_length_ms);
mSnoozeLengthMs = mDefaultSnoozeLengthMs;
mMinimumDisplayTime = resources.getInteger(R.integer.heads_up_notification_minimum_time);
mHeadsUpNotificationDecay = 200000000/*resources.getInteger(R.integer.heads_up_notification_decay)*/;;
mHeadsUpNotificationDecay = resources.getInteger(R.integer.heads_up_notification_decay);
mClock = new Clock();
// TODO: shadow mSwipeHelper.setMaxSwipeProgress(mMaxAlpha);

View File

@@ -1397,12 +1397,9 @@ public class NotificationStackScrollLayout extends ViewGroup
// add the padding before this element
height += mPaddingBetweenElements;
}
if (child instanceof ExpandableNotificationRow) {
ExpandableNotificationRow row = (ExpandableNotificationRow) child;
height += row.getIntrinsicHeight();
} else if (child instanceof ExpandableView) {
if (child instanceof ExpandableView) {
ExpandableView expandableView = (ExpandableView) child;
height += expandableView.getActualHeight();
height += expandableView.getIntrinsicHeight();
}
}
}

View File

@@ -524,8 +524,8 @@ public class StackScrollAlgorithm {
// Ensure that a headsUp is never below the topmost headsUp
StackViewState topState = resultState.getViewStateForView(topHeadsUpEntry);
childState.height = row.getHeadsUpHeight();
childState.yTranslation = Math.min(childState.yTranslation,
topState.yTranslation + topState.height - childState.height);
childState.yTranslation = topState.yTranslation + topState.height
- childState.height;
}
} else if (mIsExpanded) {
if (isTopEntry) {