Merge "Fixed a bug where shelf notifications were interactable" into oc-dr1-dev am: 91a6a10195
am: 8468fdd403
Change-Id: I21fa0deb6491970e798cfb9317b7794fb1580791
This commit is contained in:
@@ -101,6 +101,9 @@
|
|||||||
<!-- Height of a the shelf with the notification icons -->
|
<!-- Height of a the shelf with the notification icons -->
|
||||||
<dimen name="notification_shelf_height">32dp</dimen>
|
<dimen name="notification_shelf_height">32dp</dimen>
|
||||||
|
|
||||||
|
<!-- Minimum height of a notification to be interactable -->
|
||||||
|
<dimen name="notification_min_interaction_height">40dp</dimen>
|
||||||
|
|
||||||
<!-- the padding of the shelf icon container -->
|
<!-- the padding of the shelf icon container -->
|
||||||
<dimen name="shelf_icon_container_padding">13dp</dimen>
|
<dimen name="shelf_icon_container_padding">13dp</dimen>
|
||||||
|
|
||||||
|
|||||||
@@ -369,6 +369,7 @@ public class NotificationStackScrollLayout extends ViewGroup
|
|||||||
private NotificationShelf mShelf;
|
private NotificationShelf mShelf;
|
||||||
private int mMaxDisplayedNotifications = -1;
|
private int mMaxDisplayedNotifications = -1;
|
||||||
private int mStatusBarHeight;
|
private int mStatusBarHeight;
|
||||||
|
private int mMinInteractionHeight;
|
||||||
private boolean mNoAmbient;
|
private boolean mNoAmbient;
|
||||||
private final Rect mClipRect = new Rect();
|
private final Rect mClipRect = new Rect();
|
||||||
private boolean mIsClipped;
|
private boolean mIsClipped;
|
||||||
@@ -517,6 +518,8 @@ public class NotificationStackScrollLayout extends ViewGroup
|
|||||||
R.dimen.min_top_overscroll_to_qs);
|
R.dimen.min_top_overscroll_to_qs);
|
||||||
mStatusBarHeight = res.getDimensionPixelOffset(R.dimen.status_bar_height);
|
mStatusBarHeight = res.getDimensionPixelOffset(R.dimen.status_bar_height);
|
||||||
mBottomMargin = res.getDimensionPixelSize(R.dimen.notification_panel_margin_bottom);
|
mBottomMargin = res.getDimensionPixelSize(R.dimen.notification_panel_margin_bottom);
|
||||||
|
mMinInteractionHeight = res.getDimensionPixelSize(
|
||||||
|
R.dimen.notification_min_interaction_height);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setDrawBackgroundAsSrc(boolean asSrc) {
|
public void setDrawBackgroundAsSrc(boolean asSrc) {
|
||||||
@@ -1079,7 +1082,7 @@ public class NotificationStackScrollLayout extends ViewGroup
|
|||||||
final int count = getChildCount();
|
final int count = getChildCount();
|
||||||
for (int childIdx = 0; childIdx < count; childIdx++) {
|
for (int childIdx = 0; childIdx < count; childIdx++) {
|
||||||
ExpandableView slidingChild = (ExpandableView) getChildAt(childIdx);
|
ExpandableView slidingChild = (ExpandableView) getChildAt(childIdx);
|
||||||
if (slidingChild.getVisibility() == GONE
|
if (slidingChild.getVisibility() != VISIBLE
|
||||||
|| slidingChild instanceof StackScrollerDecorView) {
|
|| slidingChild instanceof StackScrollerDecorView) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -1093,7 +1096,8 @@ public class NotificationStackScrollLayout extends ViewGroup
|
|||||||
int left = 0;
|
int left = 0;
|
||||||
int right = getWidth();
|
int right = getWidth();
|
||||||
|
|
||||||
if (touchY >= top && touchY <= bottom && touchX >= left && touchX <= right) {
|
if (bottom - top >= mMinInteractionHeight
|
||||||
|
&& touchY >= top && touchY <= bottom && touchX >= left && touchX <= right) {
|
||||||
if (slidingChild instanceof ExpandableNotificationRow) {
|
if (slidingChild instanceof ExpandableNotificationRow) {
|
||||||
ExpandableNotificationRow row = (ExpandableNotificationRow) slidingChild;
|
ExpandableNotificationRow row = (ExpandableNotificationRow) slidingChild;
|
||||||
if (!mIsExpanded && row.isHeadsUp() && row.isPinned()
|
if (!mIsExpanded && row.isHeadsUp() && row.isPinned()
|
||||||
@@ -2005,6 +2009,7 @@ public class NotificationStackScrollLayout extends ViewGroup
|
|||||||
}
|
}
|
||||||
mContentHeight = height + mTopPadding + mBottomMargin;
|
mContentHeight = height + mTopPadding + mBottomMargin;
|
||||||
updateScrollability();
|
updateScrollability();
|
||||||
|
clampScrollPosition();
|
||||||
mAmbientState.setLayoutMaxHeight(mContentHeight);
|
mAmbientState.setLayoutMaxHeight(mContentHeight);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3463,7 +3468,7 @@ public class NotificationStackScrollLayout extends ViewGroup
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void updateScrollPositionOnExpandInBottom(ExpandableView view) {
|
private void updateScrollPositionOnExpandInBottom(ExpandableView view) {
|
||||||
if (view instanceof ExpandableNotificationRow) {
|
if (view instanceof ExpandableNotificationRow && !onKeyguard()) {
|
||||||
ExpandableNotificationRow row = (ExpandableNotificationRow) view;
|
ExpandableNotificationRow row = (ExpandableNotificationRow) view;
|
||||||
if (row.isUserLocked() && row != getFirstChildNotGone()) {
|
if (row.isUserLocked() && row != getFirstChildNotGone()) {
|
||||||
if (row.isSummaryWithChildren()) {
|
if (row.isSummaryWithChildren()) {
|
||||||
|
|||||||
Reference in New Issue
Block a user