summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSelim Cinek <cinek@google.com>2014-07-04 16:41:33 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2014-07-02 19:56:47 +0000
commit0bc5a6b6b34d009a571687cb6c958611290ecb75 (patch)
tree2b898dd7a8d8ccc000932071e80a94b535cdbf04
parent0002a45034b1103ffc5ecf4d5a14b7d1ba225005 (diff)
parentd7c4e004eec2a1426ef46bac439e01de09f74849 (diff)
downloadframeworks_base-0bc5a6b6b34d009a571687cb6c958611290ecb75.zip
frameworks_base-0bc5a6b6b34d009a571687cb6c958611290ecb75.tar.gz
frameworks_base-0bc5a6b6b34d009a571687cb6c958611290ecb75.tar.bz2
Merge "Fixed a bug when swiping out notifications when scrolled."
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java10
1 files changed, 9 insertions, 1 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java b/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java
index e9d67c2..ed756aa 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java
@@ -1449,7 +1449,7 @@ public class NotificationStackScrollLayout extends ViewGroup
*/
private void updateScrollStateForRemovedChild(View removedChild) {
int startingPosition = getPositionInLinearLayout(removedChild);
- int childHeight = removedChild.getHeight() + mPaddingBetweenElements;
+ int childHeight = getIntrinsicHeight(removedChild) + mPaddingBetweenElements;
int endPosition = startingPosition + childHeight;
if (endPosition <= mOwnScrollY) {
// This child is fully scrolled of the top, so we have to deduct its height from the
@@ -1462,6 +1462,14 @@ public class NotificationStackScrollLayout extends ViewGroup
}
}
+ private int getIntrinsicHeight(View view) {
+ if (view instanceof ExpandableView) {
+ ExpandableView expandableView = (ExpandableView) view;
+ return expandableView.getIntrinsicHeight();
+ }
+ return view.getHeight();
+ }
+
private int getPositionInLinearLayout(View requestedChild) {
int position = 0;
for (int i = 0; i < getChildCount(); i++) {