From 138590588bebfccae93543176ad1d38386d3fd3b Mon Sep 17 00:00:00 2001 From: Selim Cinek Date: Thu, 5 Oct 2017 17:12:18 -0700 Subject: Fixed a bug where the order of the icons was wrong Because the normal order would not factor in the yTranslation. Change-Id: Ie37b69ee5187c4f4bd58f90d8297cf73b7a4ed53 Fixes: 67017075 Test: swipe through notification in statusbar, observe right ordering --- .../android/systemui/statusbar/StatusBarIconView.java | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarIconView.java b/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarIconView.java index 2cff79df47d7..561fbb2b4aba 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarIconView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarIconView.java @@ -796,6 +796,24 @@ public class StatusBarIconView extends AnimatedImageView { } } + /** + * This method returns the drawing rect for the view which is different from the regular + * drawing rect, since we layout all children at position 0 and usually the translation is + * neglected. The standard implementation doesn't account for translation. + * + * @param outRect The (scrolled) drawing bounds of the view. + */ + @Override + public void getDrawingRect(Rect outRect) { + super.getDrawingRect(outRect); + float translationX = getTranslationX(); + float translationY = getTranslationY(); + outRect.left += translationX; + outRect.right += translationX; + outRect.top += translationY; + outRect.bottom += translationY; + } + public void setIsInShelf(boolean isInShelf) { mIsInShelf = isInShelf; } -- cgit v1.2.3-59-g8ed1b